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
//http://www.badlydrawntoy.com/2009/04/23/grid960-a-grid-overlay-bookmarklet-for-960gs/ | |
//javascript:(function(){var%20jqLoader={go:function(){if(!(window.jQuery&&window.jQuery.fn.jquery=='1.3.2')){var%20s=document.createElement('script');s.setAttribute('src','http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js');s.setAttribute('type','text/javascript');document.getElementsByTagName('head')[0].appendChild(s)}this.ok()},ok:function(){if(typeof(window.jQuery)!=='undefined'&&window.jQuery.fn.jquery=='1.3.2'){this.init()}else{setTimeout((function(){jqLoader.ok()}),100)}},init:function(){$.getScript('http://gist.github.com/raw/553926/ffef1fa9b5237a8050040da4da542608c27e0b79/jquery.960grid.bk-1.0.min.js',function(){$('body').addGrid(12)})}};jqLoader.go()})(); | |
(function($){$.fn.addGrid=function(e,f){var g={default_cols:12,z_index:999,grid_id:'grid960',img_path:'http://www.badlydrawntoy.com/static/960grid/images/',opacity:.6};var h=$.extend(g,f);if($("#"+h.grid_id).length){return}var e=e!=null&&(e===12|| |
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/env ruby | |
git_dir = '/home/i0n/git' | |
# git_dir = '/Users/i0n/sites/bin/' | |
app_name = ARGV | |
Dir.chdir git_dir | |
Dir.mkdir "#{app_name}.git" | |
Dir.chdir "#{git_dir}/#{app_name}.git" | |
system "git init --bare" | |
puts "SUCCESS!" |
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
cd /var/www | |
wget http://downloads.sourceforge.net/project/phplist/phplist/2.10.12/phplist-2.10.12.tgz?r=http%3A%2F%2Fwww.phplist.com%2Fdownload&ts=1283289462&use_mirror=ufpr | |
tar zxvf phplist-2.10.12.tgz | |
mv phplist-2.10.12 phplist | |
http://www.howtoforge.com/setting-up-phplist-newsletter-manager | |
http://docs.phplist.com/PhplistInstallation | |
/var/www/phplist/public_html/lists/config/config.php |
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
varnishd -f /usr/local/etc/varnish/default.vcl -s malloc,1G -T 127.0.0.1:2000 -a 0.0.0.0:8080 | |
varnishd -a :9292 -T localhost:6082 -f /usr/local/etc/varnish/default.vcl -s malloc,200M | |
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
Last login: Tue Jul 6 08:11:42 on console | |
$ ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)" | |
==> This script will install: | |
/usr/local/bin/brew | |
/usr/local/Library/Formula/... | |
/usr/local/Library/Homebrew/... | |
==> The following directories will be made group writable: | |
/usr/local/bin | |
/usr/local/etc | |
/usr/local/share |
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 'net/http' | |
require 'active_support/json' | |
require 'htmlentities' | |
include HtmlEntities | |
class Object | |
def to_json(options = nil) | |
ActiveSupport::JSON.encode(self, options) | |
end | |
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
def invert(code) | |
"#{code[1].chr}#{code[0].chr}" | |
end | |
def encrypt(zipcode) | |
codes = { | |
"00" => "AL", | |
"01" => "UG", | |
"10" => "CN", | |
"11" => "X8", |
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/env ruby | |
require 'rubygems' | |
require 'mechanize' | |
require 'net/smtp' | |
require 'date' | |
require 'yaml' | |
require 'nkf' | |
FROM = 'from@example.com' |
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 'net/http' | |
require 'uri' | |
require 'rubygems' | |
require 'json' | |
reddit_api_url = "http://www.reddit.com/.json" | |
resp = Net::HTTP.get_response(URI.parse(reddit_api_url)) | |
data = resp.body | |
result = JSON.parse(data) |
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
#-*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'mechanize' | |
require 'kconv' | |
agent = Mechanize.new | |
agent.get('https://login.keio.jp/koid/') | |
agent.page.form_with(:action => 'login') do |form| | |
form.field_with(:name => 'SignOnID').value = "my user ID" |