This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!$.isFunction(Array.prototype.rand)) { | |
Array.prototype.rand = function() { | |
function rand(n) { return Math.floor(Math.random() * n); } | |
return this[rand(this.length)]; | |
}; | |
} | |
$.konamiRand = (function() { | |
var fns = [], konami = function() { fns.rand()(); }; | |
$.konami(konami); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new snow leopard install process for homebrew and rvm: | |
textmate, chrome | |
ssh-keygen -t rsa | |
homebrew | |
Xcode | |
brew install git | |
install rvm (http://rvm.beginrescueend.com/rvm/install/) | |
rvm install ruby-1.8.7 | |
rvm use ruby |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var this_will_only_run_once = (function() { | |
var has_been_run = false; // this private variable will be kept between runs, but doesn't pollute the global namespace | |
return function() { | |
if (has_been_run) return; has_been_run = true; | |
// do stuff here, it will only be run once | |
}; | |
})(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mousewheel_handler = (function() { | |
var threshold = 0.75, | |
scrolled_amount = 0; | |
return function(e, delta, deltaX, deltaY) { | |
scrolled_amount += deltaY; | |
if (scrolled_amount > threshold) { | |
move.up(); | |
scrolled_amount = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= highlight(t(:'.confirm', :resource => resource, :default => :'delete.confirm'), resource.to_s) %> | |
<%= semantic_form_for resource, :html => { :method => :delete } do |form| %> | |
<%= form.buttons do %> | |
<%= form.commit_button :delete %> | |
<% end %> | |
<% end %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def indefinitize(string) | |
vowels = "aeiou".split(//) | |
vowels.include?(string.first.downcase) ? "an #{string}" : "a #{string}" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var validate = (function() { | |
var c = { log: function() {} }; | |
// var c = console; | |
var f = function() { | |
$(this).each(function() { | |
var t = $(this); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
As of version 1.1.2, Propane will load and execute the contents of | |
~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
immediately following the execution of its own enhancer.js file. | |
You can use this mechanism to add your own customizations to Campfire | |
in Propane. | |
Below you'll find two customization examples. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env.each do |key, value| | |
Rails.logger.error("#{key.inspect} => #{value.inspect}"[0..150]) | |
end |