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/env ruby | |
require 'rubygems' | |
require 'aws/s3' # sudo gem install aws-s3 | |
require 'logger' | |
require 'optparse' | |
AWS::S3::Base.establish_connection!( | |
:access_key_id => 'TODO', | |
:secret_access_key => 'TODO' | |
) |
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
$.extend({ | |
poller: function(originalOptions){ | |
$.extend({ | |
interval: 0 /* Use this if you want to setup a short poller */ | |
}, originalOptions); | |
var applyRepoll = function(callback){ | |
return function(){ | |
if(typeof callback === 'function'){ | |
callback.apply(originalOptions, arguments); |
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/env ruby | |
require 'rubygems' | |
require 'beanstalk-client' | |
host = ENV['host'] || 'localhost:11300' | |
stat = File.basename(__FILE__).split('_').last | |
# stat = 'watching' # watching jobs-reserve jobs-ready using jobs-buried waiting jobs-delayed jobs-urgen | |
B = Beanstalk::Connection.new(host) | |
tubes = B.list_tubes |
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
# Spell checking ruby env | |
# !!!! IMPORTANT Be sure you have iSpell installed: sudo port install ispell !!!! | |
require 'stringio' | |
begin | |
require 'simplecc' | |
rescue LoadError | |
# to satisfy rdoc | |
class Continuation #:nodoc: |
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
/* @override http://blog.bradgessler.com/stylesheets/polleverywhere.css */ | |
.peTitle { | |
text-align: left !important; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
} | |
.peOptions { padding: 10px 5px 15px !important; } | |
.peWidget { | |
-moz-border-radius: 10px !important; | |
-webkit-border-radius: 10px !important; |
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
$.extend({ | |
poller: function(originalOptions){ | |
var applyRepoll = function(callback){ | |
return function(){ | |
if(typeof callback === 'function'){ | |
callback.apply(originalOptions, arguments); | |
} | |
$.poller(originalOptions); | |
}; | |
}; |
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
class Switch | |
def initialize(obj, &block) | |
@obj, @procs = obj, [] | |
instance_eval(&block) | |
@proc = @procs.detect{|p| p.call } | |
end | |
def call | |
@proc.call if @proc | |
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
#### From the Shell... | |
~ $ cat /Volumes/localhost/polleverywhere/vendor/plugins/deep_cloning/lib/deep_cloning.rb | |
#### The series of HTTP requests that took place... | |
------------------Request ------------------ | |
PROPFIND /polleverywhere/vendor/plugins/acts_as_infinite HTTP/1.1 | |
Host: localhost:5000 |
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 button_tag_menu(value, options={}, &block) | |
options[:onclick] = "$(this).up('.menuButton').down('.menu').show();" | |
%{ | |
<div class="menuButton"> | |
#{button_tag(value, options)} | |
<div class="menu" style="display: none;"> | |
#{capture(&block)} | |
</div> | |
</div> | |
} |
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
# Creates an array out of the words in a string | |
>> %w[one two three] | |
=> ["one", "two", "three"] | |
# Executes a system command and captures the output as a string | |
>> %x[ls] | |
=> "Applications\nDesktop\nDocuments\nDownloads\nDropbox\nLibrary\nMovies\nMusic\nPictures\nProjects\nPublic\nSites\nVirtual Machines\npe\n" | |
# Creates a regexp object | |
>> %r{(\w+)\.html} |