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
module Jekyll | |
class Layout | |
alias old_initialize initialize | |
def initialize(*args) | |
old_initialize(*args) | |
self.transform | |
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
{ | |
votes: 21, | |
monitor: false, | |
success: true, | |
voters: 2, | |
start_time: 1348246303.613473, | |
polls: [ | |
{ | |
nonce: '8ec402a536549c841b8778a7f8ca2a24', | |
va: 16, |
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
<html> | |
<head> | |
<title>{Title}{block:SearchPage} ({lang:Search results for SearchQuery}){/block:SearchPage}{block:PermalinkPage}{block:PostSummary} — {PostSummary}{/block:PostSummary}{/block:PermalinkPage}</title> | |
<meta charset="utf-8"> | |
<meta name="description" content="{block:IndexPage}{block:Description}{MetaDescription}{/block:Description}{/block:IndexPage}{block:PermalinkPage}{block:PostSummary}{PostSummary}{/block:PostSummary}{/block:PermalinkPage}" /> | |
<meta name="color:Accent" content="#4EA3D0"/> | |
<meta name="font:Body" content="'Helvetica Neue', Helvetica, Arial, sans-serif"/> | |
<meta name="if:Two column posts" content="1"/> |
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 backtop = document.getElementById('backtop');//need a button id is 'backtop' | |
backtop.onclick = function () { | |
backTimer = setInterval(_back, 30); | |
}; | |
var backTimer; | |
function _back () { | |
var _body = document.documentElement; | |
if (!_body.scrollTop) { | |
_body = document.body; | |
} |
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 'open-uri' | |
pollNumber = '7040303' | |
ourPick = '31993122' | |
uriString = 'http://polldaddy.com/n/64270c358614e8ef9383968590e82f73/'.concat(7040303).concat('?').concat(Time.now.to_i.to_s()) | |
puts uriString | |
# Headers | |
HEADERS = { | |
'Host' => 'polldaddy.com', | |
'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.75 Safari/535.7', |
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
# Using the web automation driver (watir-webdriver) through the tor network | |
# Automates webpage actions & bypasses the voting limit on polldaddy | |
# Casts a vote every 3 seconds for a total of 1000 votes | |
require 'watir-webdriver' | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile.proxy = Selenium::WebDriver::Proxy.new :http => '127.0.0.1:8118' | |
b = Watir::Browser.new :firefox, :profile => profile | |
#b = Watir::Browser.new :firefox | |
b.goto '/polldaddy.com/poll/7040303/' |
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
ruby -run -e httpd . -p 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
#!/bin/sh | |
printf "\n " | |
for i in {0..255} ; do | |
colcode="colour${i}" | |
printf "\x1b[38;5;${i}m%-10s " $colcode | |
if [ $((($i+1) % 8)) = 0 ] ; then | |
printf "\n " | |
fi | |
done | |
printf "\n" |
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
# -*- encoding: utf-8 -*- | |
require 'sinatra' | |
require 'slim' | |
require 'warden' | |
require 'dm-core' | |
require 'dm-migrations' | |
require 'dm-timestamps' | |
require 'dm-validations' |
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 'date' | |
require 'koala' | |
class BirthdayLiker | |
FACEBOOK_TOKEN = 'your_oauth_key' | |
BIRTHDAY_WORDS = %w(birthday bday birfday birth born) | |
THANKS_OPTIONS = ['Thank you!', 'Thanks!', 'Appreciate it!'] | |
DATE_TIME_FORMAT = '%Y-%m-%d' | |
def initialize(birthdate, opts={}) |
OlderNewer