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 | |
require 'rubygems' | |
require 'open-uri' | |
require 'hpricot' | |
doc = Hpricot(open('http://www.stanford.edu/class/cs193p/cgi-bin/drupal/downloads-2010-winter')) | |
(doc/"a").each do |x| |
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 | |
require 'rubygems' | |
require 'open-uri' | |
require 'hpricot' | |
doc = Hpricot(open("http://www.timeanddate.com/worldclock/astronomy.html?n=136&month=12&year=2010&obj=sun&afl=-11&day=1")) | |
sunrise_rows = (doc/"table.spad tr") |
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 | |
require 'rubygems' | |
require 'open-uri' | |
require 'hpricot' | |
dependencies = [:wget, :curl] | |
dependencies.each { |program| !`which #{program.to_s}`.empty? || STDERR.puts( "Requires #{program}") } | |
index_doc = Hpricot(open("http://confreaks.net/events/scotlandruby2011")) |
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
$(document).ready -> | |
$("#fb-root").append "<script type=\"text/javascript\" src=\"#{document.location.protocol}//connect.facebook.net/en_GB/all.js\" async=\"true\"></script>" | |
window.fbAsyncInit = () -> | |
FB.init | |
appId: '172659579460514' | |
status: true | |
cookie: true | |
xfbml: true |
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 User | |
# attr :password | |
include DataMapper::Resource | |
property :id, Serial | |
property :name, String | |
property :email, String | |
property :password, String |
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
window.template_manager = new TemplateManager() | |
configuration = {} | |
template_manager.load_template "tabs", "/templates/_tabitems.handlebars", -> | |
markup = template_manager.transform "tabs", configuration | |
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 | |
pid = Process.fork do | |
exec 'ls -al' | |
end | |
puts "pid is #{pid}" | |
Process.detach pid |
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 | |
require 'rubygems' | |
require 'datamapper' | |
require 'rspec' | |
class Book | |
include DataMapper::Resource | |
property :id, Serial |
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
#/**********************************************************\ | |
# | |
# Auto-Generated Plugin Configuration file | |
# for Concept PM Communicator | |
# | |
#\**********************************************************/ | |
set(PLUGIN_NAME "ConceptPMCommunicator") | |
set(PLUGIN_PREFIX "CPC") | |
set(COMPANY_NAME "TactusworksLtd") |
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
$ = jQuery | |
$.extend $.fn, | |
serializeObject: () -> | |
e = $(this) | |
a = e.serializeArray() | |
o = {} | |
$.each a, -> | |
if o[this.name] != undefined |
OlderNewer