Creating an internal link to edit a user's profile in Drupal 6
Submitted by Sam Rose on Tue, 03/10/2009 - 01:46Getting where you want to go in Drupal
Submitted by Sam Rose on Sat, 02/14/2009 - 06:15The following information applies to Drupal 5.x
If you are working with a protected site, using http://drupal.org/project/login_destination module is a good way to create a logic system for routing users.
In my case, I needed people to get to where they were trying to go in the first place when logging in.
For instance, if a user visits example.com/blog, and is prompted to login first, then I want them to arrive at *exactly* example.com/blog after they successfully login.
So, http://drupal.org/project/login_destination provides this functionality.
Taxonomy Section Custom Drupal Code
Submitted by Sam Rose on Sun, 02/08/2009 - 23:27
$taxo_section_string = $taxo_section; $taxo_section_tids = taxonomy_get_term_by_name($taxo_section_string); if (!$taxo_section_tids) { // add section into this issue // this will only occur with new section names $status = taxonomy_save_term($form_values);
none
Install Ruby Gems on Ubuntu Intrepid 8.10
Submitted by Sam Rose on Sat, 01/24/2009 - 23:31Do this:
$ wget http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz $ tar rubygems-1.3.1.tgz $ cd rubygems-1.3.1 $ sudo ruby setup.rb #you can do ruby setup.rb --help to see options $ sudo sudo ln -s /usr/bin/gem1.8 /usr/bin/gem $ sudo gem -v 1.3.1
Done!
Donation Networks
Submitted by Sam Rose on Sat, 01/24/2009 - 12:12After some months working privately with agent based Altruism and Cooperation models, I am working towards initiating an experiment with with a small number regional and continental participants in creating a balanced donation and distribution system.
The system is fairly simple:
This method adds nodes to the graph dynamically. BirdEye Code Example
Submitted by Sam Rose on Fri, 01/09/2009 - 21:36
======================= /* * This method adds nodes to the graph dynamically. */ private function addNodesToGraph(newNodes:XML):void { vgraph.newNodesDefaultVisible = true; var nodes:XMLList = newNodes.child("Node"); var edges:XMLList = newNodes.child("Edge"); //Keep track of root node. var root:IVisualNode=vgraph.currentRootVNode; for (var i:Number = 0; i < nodes.l
How to create a site redirect on a sub-directory using .htaccess and PHP
Submitted by Sam Rose on Wed, 01/07/2009 - 03:27I needed to make the old http://socialsynergyweb.org/oardc domain point to the new home at http://localfoodsystems.org (and include all sub-directory listings under /oardc). Plus, it was desired to place a message letting people know about a timed redirect, and to "update your book marks".
So, here is what I did:
The .htaccess file:
RedirectMatch 301 ^/oardc/.*$ http://socialsynergyweb.org/lfs/index.php
This simply finds everything that is under http://socialsynergyweb.org/oardc and redirects to http://socialsynergyweb.org/lfs/index.php
A discussion with Richard Schulte about creating an open distributed agriculture research network
Submitted by Sam Rose on Sat, 01/03/2009 - 05:44A Jabber discussion today with Richard Schulte about how to go about creating an open distributed agriculture research network see attached file
Building a capistrano recipe into a rails2 application, to deploy Drupal clone sites (or other cloned web applications)
Submitted by Sam Rose on Thu, 01/01/2009 - 00:28I needed to build a way to deploy Drupal sites to support a limited hosting application for http://socialmediaclassroom.com project.
I decided to build an application using http://www.capify.org/ (Capistrano). I thought about developing this in http://drupal.org/project/drush. However, time constraints dictated otherwise.
I ended up working on this with partner Paul B. Hartzog. Here is what we did:
A test
Submitted by Sam Rose on Mon, 12/29/2008 - 08:12Some Python:
# Function defined outside the class def f1(self, x, y): return min(x, x+y) class C: f = f1 def g(self): return 'hello world' h = g
Some ruby:
# Ruby knows what you # mean, even if you # want to do math on # an entire Array cities = %w[ London Oslo Paris Amsterdam Berlin ] visited = %w[Berlin Oslo] puts "I still need " + "to visit the " + "following cities:", cities - visited
Some php:
<?php