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 speed_bump(&block) | |
| sleep(1) | |
| yield | |
| sleep(1) | |
| 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
| [1:46am] <bitpimpin> !task Again. | |
| [1:46am] <lurch_bot> A task ('Again.') was created at Tue Mar 24 01:46:41 -0400 2009. <ID:8957300> | |
| [1:46am] <bitpimpin> !tag 8957300 test,this,out | |
| [1:46am] <lurch_bot> Found object <8957300>: | |
| [1:46am] <lurch_bot> Tagged! Test | |
| [1:46am] <lurch_bot> Tagged! This | |
| [1:46am] <lurch_bot> Tagged! Out | |
| [1:47am] <bitpimpin> !tasks | |
| [1:47am] <lurch_bot> <ID:8957300>(Again.): 27.233957 seconds | Tagged: test, this, out. | |
| [1:47am] <bitpimpin> !tasks |
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
| # wadl.rb | |
| # http://www.crummy.com/software/wadl.rb/ | |
| # Super cheap Ruby WADL client | |
| # by Leonard Richardson leonardr@segfault.org | |
| # v20070217 | |
| # For more on WADL, see http://wadl.dev.java.net/ | |
| require 'rubygems' | |
| require 'rest-open-uri' |
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
| // (Excerpt from http://tinyurl.com/c4e47q) | |
| // At this point, I'd like to take a moment to speak to you about the Adobe PSD format. | |
| // PSD is not a good format. PSD is not even a bad format. Calling it such would be an | |
| // insult to other bad formats, such as PCX or JPEG. No, PSD is an abysmal format. Having | |
| // worked on this code for several weeks now, my hate for PSD has grown to a raging fire | |
| // that burns with the fierce passion of a million suns. | |
| // If there are two different ways of doing something, PSD will do both, in different | |
| // places. It will then make up three more ways no sane human would think of, and do those | |
| // too. PSD makes inconsistency an art form. Why, for instance, did it suddenly decide | |
| // that *these* particular chunks should be aligned to four bytes, and that this alignement |
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
| Xzibit = Object clone do( | |
| dawg = method(what, | |
| "yo dawg" print. | |
| what print. | |
| "clone" print. | |
| self | |
| ). | |
| so_you_can = method( | |
| "so you can print" print. |
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
| class HoboType::Cents < DelegateClass(Fixnum) | |
| COLUMN_TYPE = :integer | |
| HoboFields.register_type(:cents, self) | |
| def initialize(value) | |
| super(centsify value) | |
| 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
| require 'open-uri' | |
| # url dsl -- the ultimate url dsl! | |
| # | |
| # You just can't beat this: | |
| # | |
| # $ irb -r url_dsl | |
| # >> include URLDSL | |
| # => Object | |
| # >> http://github.com/defunkt.json |
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
| div.header { | |
| padding: 0; | |
| height: 100px; | |
| } | |
| div.header a.logo { | |
| display: block; | |
| width: 237px; | |
| height: 43px; | |
| background: url(img/logo.png) no-repeat; |
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
| <script> | |
| // test for localStorage support | |
| if(('localStorage' in window) && window['localStorage'] !== null){ | |
| var f = document.getElementById('mainform'); | |
| // test with Ruby if the form was sent (the submit button has the name "sent") | |
| <% if params[:sent] %> | |
| // get the HTML of the form and cache it in the property "state" | |
| localStorage.setItem('state',f.innerHTML); | |
| // if the form hasn't been sent... | |
| <% else %> |
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
| #!/bin/sh | |
| # Some fixes are from http://blog.segment7.net/articles/2006/03/02/fast-memcached-on-os-x | |
| # | |
| # AFTER RUNNING THIS SCRIPT: | |
| # | |
| # Set the environment variable EVENT_NOKQUEUE to 1 | |
| # * csh and derivatives: setenv EVENT_NOKQUEUE 1 | |
| # * sh and derivatives (like bash): export EVENT_NOKQUEUE=1 | |
| # |