Skip to content

Instantly share code, notes, and snippets.


Chris Christensen christianchristensen

View GitHub Profile
View random_iterator.rb
module Enumerable
# Iterate over this array randomly.
# From:
# And:
def randomized
return to_enum(:randomized) unless block_given?
def is_prime?(num)
i = 3
View features moving
git checkout laterBranchOrTag
// (add the CCK fields/types that need to be migrated tofeatureNameNew- delete the references from featureNameOld. note: this will cause the field to be deleted)
git commit
git checkout earlierBranchOrTag
drush features revert featureNameOld
// (cacheclear, etc...extra: add the variables and some other items to featureNameNew from featureNameOld - i.e. they will exist in both for now)
git checkout laterBranchOrTag
drush features-updatefeatureNameNew
git commit
View select_jump_list.js
$('select.jump_list').change(function() {
if (!this.value) {
var url, url_len, last_char;
if (this.value.match('://')) { = this.value;
View gist:544478
class MinSplPriorityQueue extends SplPriorityQueue
public function compare($priority1, $priority2)
if ($priority1 === $priority2) return 0;
return $priority1 > $priority2 ? -1 : 1;
View gist:615484
javascript:for(var i=0;i<document.links.length;i++){var a=document.links[i];if(a.href.indexOf('mailto:')==0){a.innerHTML=a.href;'red';'white'}};return true;
View gist:1001601
# Cookbook Name:: openldap
# Attributes:: openldap
# Copyright 2008-2009, Opscode, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
View enterprise.txt
________________ _
\ \ `,--,-.___.----'