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/env ruby | |
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'json' | |
require 'pp' | |
require 'digest/md5' | |
require 'net/https' | |
require 'pit' | |
require 'cgi' |
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 'sinatra/base' | |
class CacheHelper | |
module Sinatra | |
module Helpers | |
def cache(name, options = {}, &block) | |
if cache = read_fragment(name, options) | |
@_out_buf << cache | |
else | |
pos = @_out_buf.length |
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
if(typeof(models)=='undefined') | |
this.models = models = new Repository(); | |
var Pinboard = { | |
name : 'Pinboard', | |
ICON : 'http://pinboard.in/favicon.ico', | |
getCurrentUser : function() { | |
if(decodeURIComponent(getCookieString('pinboard.in', 'login')).match(/login=(.*?) /)) | |
return RegExp.$1; |
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
# -*- encoding: utf-8 -*- | |
require 'rexml/document' | |
require 'net/http' | |
class MA | |
def initialize | |
path = File.join(File.dirname(__FILE__), "..", "config", "yahooapis.yml") | |
config = YAML::load(File.open(path)) | |
@app_id = config['app_id'] | |
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
require 'formula' | |
class Vim < Formula | |
homepage 'http://www.vim.org/' | |
url 'ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2' | |
head 'https://vim.googlecode.com/hg/' | |
sha256 '5c5d5d6e07f1bbc49b6fe3906ff8a7e39b049928b68195b38e3e3d347100221d' | |
version '7.3.682' | |
def features; %w(tiny small normal big huge) 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
# | |
# this file format is YAML | |
# | |
acount_basic: | |
screen_name1: | |
user: screen_name1 | |
password: password1 | |
screen_name2: | |
user: screen_name2 | |
password: password2 |
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/env ruby | |
require 'kconv' | |
require 'rubygems' | |
require 'rbosa' | |
class ItunesCLI | |
COMMANDS = { | |
'next' => :next_track, | |
'n' => :next_track, |
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
p() { | |
local pid exit | |
# http://www.filesonic.com/file/703099021 | |
play -l ~/Music/Nyan\ Cat.mp3 & | |
pid=$! | |
trap "kill -9 $pid" INT | |
command $* | |
exit=$? | |
kill -9 $pid | |
trap INT |
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/env ruby | |
require 'fileutils' | |
require 'digest/md5' | |
def main | |
file = File.expand_path("~/Dropbox/Public/g/#{Digest::MD5.hexdigest(Time.now.to_f.to_s)}.png") | |
url = 'https://dl.dropboxusercontent.com/u/334064/g/' + File.basename(file) | |
FileUtils.mkdir_p File.dirname(file) |
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/env ruby | |
require 'rubygems' | |
require 'sinatra/base' | |
require 'ruby-growl' | |
require 'launchy' | |
class GrowlServer < Sinatra::Base | |
set :port, 5678 |
OlderNewer