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
# coding: utf-8 | |
module Mail | |
class Ruby19 | |
def Ruby19.b_value_decode(str) | |
match = str.match(/\=\?(.+)?\?[Bb]\?(.+)?\?\=/m) | |
if match | |
encoding = match[1] | |
str = Ruby19.decode_base64(match[2]) | |
str.force_encoding(fix_encoding(encoding)) |
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
# basic | |
set-option utf8-default on | |
set-window-option -g utf8 on | |
set-window-option -g mode-keys vi | |
set-window-option -g automatic-rename off | |
# key bind | |
set-option -g prefix C-j | |
unbind-key C-j | |
bind-key C-j send-prefix |
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 'capistrano/recipes/deploy/strategy/remote_cache' | |
class RemoteCacheSubdir < Capistrano::Deploy::Strategy::RemoteCache | |
private | |
def repository_cache_subdir | |
if configuration[:deploy_subdir] then | |
File.join(repository_cache, configuration[:deploy_subdir]) | |
else | |
repository_cache | |
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 'capistrano/ext/multistage' | |
require 'bundler/capistrano' | |
require 'erb' | |
set :application, "app" | |
set :scm, :git | |
set :repository, "git://domain.com/path/to/repository.git" | |
set :deploy_subdir, "/path/to/app" # require https://gist.github.com/970910 to Capfile | |
set :deploy_via, :copy | |
set :use_sudo, false |
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 defined? Rails::Console | |
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ActiveResource::Base.logger = Logger.new(STDOUT) | |
if defined? Hirb | |
Hirb.enable | |
end | |
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
find . -name '*.html.erb' | xargs grep -l ' ' | xargs sed -i.bak 's/ / /g' |
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
var express = require('express'); | |
var app = express.createServer(); | |
app.get('/', function(req, res) { | |
res.send('Hello World'); | |
}); | |
app.listen(3000); |
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 program is free software. It comes without any warranty, to | |
// the extent permitted by applicable law. You can redistribute it | |
// and/or modify it under the terms of the Do What The Fuck You Want | |
// To Public License, Version 2, as published by Sam Hocevar. See | |
// http://sam.zoy.org/wtfpl/COPYING for more details. | |
var express = require('express'); | |
var app = express.createServer(); | |
var oauth = new (require('oauth').OAuth)( | |
'https://api.twitter.com/oauth/request_token', |
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
var sys = require('sys'); | |
var ws = require('websocket-server'); | |
var server = ws.createServer(); | |
var relay = new (require('websocket-client').WebSocket)('ws://localhost:8000'); | |
var Parameter = { | |
pack: function(json) { | |
return JSON.stringify(json); | |
}, |
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
["ABC", "DEF", "GHJ"].join("").split("").reverse.each {|str| puts str} |