This file contains 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
## Note to self... | |
include Benchmark | |
number = 2 | |
year = 2008 | |
bmbm(6) do |x| | |
x.report 'joining' do | |
10_000.times do |
This file contains 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 lifted from TextMate's Ruby snippets. It's kind of handy and comes up now and then. | |
module | |
module ClassMethods | |
end | |
module InstanceMethods | |
end | |
This file contains 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
// By Oliver Saunders. http://wiki.github.com/schapin/gospel/textmate-language-file | |
{ scopeName = 'source.gospel'; | |
fileTypes = ( 'gs' ); | |
foldingStartMarker = '/\*\*|\{\s*$'; | |
foldingStopMarker = '\*\*/|^\s*\}'; | |
patterns = ( | |
{ name = 'keyword.constant.gospel'; | |
match = '\b(recurse|namespace)\b'; | |
}, | |
{ name = 'meta.heading.text'; |
This file contains 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
/* | |
* Extends Date to return the 24-hour clock time using 15 minute intervals for the | |
* minutes portion. E.x. If it is 11:04PM, this function returns 2300. | |
*/ | |
Date.prototype.getInterval = function() { | |
var now = new Date(); | |
var intervals = ["00", "15", "30", "45", "60"]; | |
for(var i = 0; i < intervals.length; i++) { | |
var mins = now.getMinutes(); | |
if(parseInt(intervals[i], 10) <= mins && mins <= parseInt(intervals[i + 1], 10)) { |
This file contains 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
(~)→ sudo port install screen | |
---> Fetching screen | |
---> Verifying checksum(s) for screen | |
---> Extracting screen | |
---> Applying patches to screen | |
---> Configuring screen | |
---> Building screen | |
Error: Target org.macports.build returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_screen/work/screen-4.0.3" && make all " returned error 2 | |
Command output: vproc_priv.h:101: warning: parameter names (without types) in function declaration | |
vproc_priv.h:101: warning: data definition has no type or storage class |
This file contains 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
#!/usr/bin/ruby | |
# jsmin.rb 2007-07-20 | |
# Author: Uladzislau Latynski | |
# This work is a translation from C to Ruby of jsmin.c published by | |
# Douglas Crockford. Permission is hereby granted to use the Ruby | |
# version under the same conditions as the jsmin.c on which it is | |
# based. | |
# | |
# /* jsmin.c | |
# 2003-04-21 |
This file contains 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 generate(params, defaults = {}) | |
param_or_default = lambda { |p, d, k| (p[k] || d[k]).to_s } | |
matches = lambda { |v| v =~ /^(?-mix:[^\/.,;?]+)$/ } | |
v_controller = param_or_default.call(params, defaults, :controller) | |
v_action = param_or_default.call(params, defaults, :action) | |
v_id = param_or_default.call(params, defaults, :id) | |
unless matches.call(v_controller) | |
raise ArgumentError, "Condition cannot be generated with #{params.inspect}" |
This file contains 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
## | |
# XCode stuff for Git | |
## | |
## .gitignore | |
# xcode noise | |
build/* | |
*.pbxuser | |
*.mode1v3 |
This file contains 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
#!/usr/bin/ruby | |
# jsmin.rb 2007-07-20 | |
# Author: Uladzislau Latynski | |
# | |
# This work is a translation from C to Ruby of jsmin.c published by | |
# Douglas Crockford. Permission is hereby granted to use the Ruby | |
# version under the same conditions as the jsmin.c on which it is | |
# based. | |
# | |
# jsmin.c |
This file contains 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 heaviy modified version of Peter Vulgaris' jquery.autosuggest | |
* plugin. In fact, you're probably going to need to do some heavy squinting | |
* to recognize the original code. | |
* | |
* What's Different? | |
* ================= | |
* | |
* Cleaner Code | |
* ------------ |
OlderNewer