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
var clickFirst = function() { | |
var $link = $('.pretty-button.positive:not(.pressed):first'); | |
if($link.length > 0) { | |
console.log("clicking"); | |
$link.click(); | |
} else { | |
console.log("no more links"); | |
} | |
}; |
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 https://gist.github.com/GordonDiggs/9d9eb3007055fa04f0c4 | |
Add this to your caveatPatchor.js file | |
(located at ~Library/Application Support/Propane/unsupported/caveatPatchor.js) | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
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
require 'nokogiri' | |
require 'open-uri' | |
url = 'http://wfmu.org/currentliveshows_aggregator.php?ch=1,4,6,7,8&_=1422680555670' | |
body = open(url) | |
document = Nokogiri::HTML(body) | |
song = document.css('.bigline')[0].text.gsub(/[\n\r]/, ' ').strip | |
show = document.css('.smallline')[0].text.gsub(/[\n\r]/, ' ').strip |
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
require 'weather-api' | |
woeid = '12761740' | |
response = Weather.lookup(woeid, Weather::Units::FARENHEIT) | |
puts "#{response.condition.temp}\u00B0 #{response.condition.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
require 'benchmark/ips' | |
def quux(hash_arg) | |
hash_arg = hash_arg.dup | |
10.times { |i| hash_arg.merge!({ "num_#{i}" => i }) } | |
end | |
def corge(hash_arg) | |
hash_arg = Hash[hash_arg] | |
10.times { |i| hash_arg.merge!({ "num_#{i}" => i }) } |
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
Calculating ------------------------------------- | |
dup 5.339k i/100ms | |
deep_dup 4.367k i/100ms | |
Hash[] 5.156k i/100ms | |
------------------------------------------------- | |
dup 54.493k (± 7.2%) i/s - 272.289k | |
deep_dup 45.231k (± 9.1%) i/s - 227.084k | |
Hash[] 59.868k (± 7.5%) i/s - 299.048k | |
Comparison: |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlueColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECYw | |
LjExMTU1NjIxNzEgMC4xNDQyMDcxMDUgMC41ODIxMTkxNjY5ABABgALSEBESE1okY2xh | |
c3NuYW1lWCRjbGFzc2VzV05TQ29sb3KiEhRYTlNPYmplY3RfEA9OU0tleWVkQXJjaGl2 |
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
@echo off | |
set drive=W:\BACKUP_docs | |
set musicdrive=W:\BACKUP_music | |
set backupcmd="C:\backup batches\wndsync.exe" /back /r /auto /showA | |
set cleancmd="C:\backup batches\dirclean.exe" -r -d -s | |
echo Started Backup: %date% - %time% >> w:\logs\backup.txt | |
echo ### Backing up Home Folder... | |
%cleancmd% -i "%drive%" |
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 | |
# Assassin - Random and fair pairing for a game of assassin of any size (defaults to 10) | |
# Takes number of players from args | |
num_players = ARGV[0].to_i == 0 ? 10 : ARGV[0].to_i | |
killers = (0..num_players-1).to_a | |
targets = killers.shuffle | |
puts "killers: #{killers.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
PGError: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. : SELECT id FROM address_books LIMIT 1 | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.8/lib/active_record/connection_adapters/abstract_adapter.rb:221:in `log' | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/activerecord-2.3.8/lib/active_record/connection_adapters/postgresql_adapter.rb:520:in `execute' | |
/home/gordon/paperless/paperlesspost/paperless-post/app/jobs/address_book_importer.rb:8:in `perform' | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/bundler/gems/resque-status-0ad44dfe6987/lib/resque/job_with_status.rb:110:in `safe_perform!' | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/bundler/gems/resque-status-0ad44dfe6987/lib/resque/job_with_status.rb:87:in `perform' | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/resque-1.10.0/lib/resque/job.rb:133:in `perform' | |
/home/gordon/.rvm/gems/ruby-1.8.7-p302/gems/resque-1.10.0/lib/resque/worker.rb:157:in `perform' | |
/home/gordon/.rvm/ge |