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
javascript:function iprl5() { | |
var d=document, | |
z=d.createElement('scr'+'ipt'), | |
b=d.body, | |
l=d.location; | |
try { | |
if (!b) throw(0); | |
d.title='(Saving...)'+d.title; | |
z.setAttribute('src',l.protocol+'//www.instapaper.com/j/LIq7XKV1Bp1I?u='+encodeURIComponent(l.href)+'&t='+(new Date().getTime())); |
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
## somewhere | |
module Persistence | |
class IdentityMap | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
DataMapper.repository { @app.call(env) } | |
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
<html> | |
<body> | |
<div id="login" style="display: none"> | |
<fb:login-button perms="email"></fb:login-button> | |
</div> | |
<div id="logout" style="display: none"> | |
<button onclick="FB.logout()">Log out</button> | |
</div> |
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
# O.o | |
# http://opensoul.org/blog/archives/2010/12/12/the-ruby-infinite-hash/ | |
>> hash = Hash.new { |h, k| h[k] = Hash.new(&h.default_proc) } | |
=> {} | |
>> hash['a'] = 1 | |
=> 1 | |
>> hash['a'] | |
=> 1 | |
>> hash['b'] |
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
#!/usr/bin/ruby | |
require 'yaml' | |
# DATA is a little-used feature of the Ruby language; it's a file handle | |
# whose contents are everything in the current file after the __END__. | |
# YAML is "Yet Another Markup Language". | |
data = YAML.load(DATA) | |
def url_for(entry_num) |
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
set -g prefix C-a | |
unbind C-b | |
bind C-a send-prefix | |
set-window-option -g mode-keys vi | |
bind k up-pane | |
bind j down-pane |
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
#!/usr/bin/ruby | |
LOGIN, PASSWORD = 'your_number', 'your_password' | |
require 'rubygems' | |
require 'mechanize' | |
agent = Mechanize.new | |
agent.get 'https://wireless.att.com' | |
login = agent.page.forms_with(:name=>'loginActionForm').first |
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
#!/usr/bin/ruby | |
require 'rubygems' | |
require 'mechanize' | |
print "email: " | |
email = gets.chomp | |
print "password: " | |
password = gets.chomp | |
agent = Mechanize.new |
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 'xmpp4r' | |
include Jabber | |
Client.new(JID.new "#{USERNAME}/Home").instance_eval do | |
connect 'talk.google.com' | |
auth PASSWORD | |
send Message.new(RECIPIENT, MESSAGE).tap{|m| m.type = :chat } | |
close | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
{block:Description}<meta name="description" content="{MetaDescription}" />{/block:Description} | |
<meta name="text:Twitter Username" content=""/> | |
<meta name="text:Flickr Username" content=""/> | |
<meta name="text:Disqus Shortname" content=""/> | |
<meta name="color:Asterisk" content="#17f0ff"/> |
OlderNewer