Skip to content

Instantly share code, notes, and snippets.

View christianchristensen's full-sized avatar

Chris Christensen christianchristensen

View GitHub Profile
module Enumerable
# Iterate over this array randomly.
# From: http://stackoverflow.com/questions/2459913/how-can-i-randomly-iterate-through-a-large-range
# And: http://refactormycode.com/codes/40-is_prime
def randomized
return to_enum(:randomized) unless block_given?
def is_prime?(num)
i = 3
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
$('select.jump_list').change(function() {
if (!this.value) {
return;
}
var url, url_len, last_char;
if (this.value.match('://')) {
window.top.location = this.value;
}
<?php
class MinSplPriorityQueue extends SplPriorityQueue
{
public function compare($priority1, $priority2)
{
if ($priority1 === $priority2) return 0;
return $priority1 > $priority2 ? -1 : 1;
}
}
.DS_Store
*.csv
*.pdf
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;a.style.backgroundColor='red';a.style.color='white'}};return true;
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
________________ _
\__(=======/_=_/____.--'-`--.___
\ \ `,--,-.___.----'
.--`\\--'../
'---._____.|]
@christianchristensen
christianchristensen / gist:1244308
Created September 27, 2011 03:59
LucidChart Collapse toolbox bookmarklet
javascript:void(function(){document.getElementById("tool-box-wrapper").style.display="none";document.getElementById("viewport-container").style.left="0px";}());