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' | |
require 'image_size' | |
class ConvertAssetInline | |
def initialize | |
@orig = nil | |
@cache = {} | |
end | |
def convert(url) |
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/ruby | |
# set ft=ruby ts=2 sts=2 sw=2 fileencoding=utf-8 | |
path = "/Users/holy/work/test-git" | |
git = '/opt/local/bin/git' | |
######################## | |
require 'open3' |
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
mysql> SELECT CAST('2011-03-31' AS DATE) BETWEEN '2011-02-28 15:00:00' AND '2011-03-30 15:00:00'; | |
+------------------------------------------------------------------------------------+ | |
| CAST('2011-03-31' AS DATE) BETWEEN '2011-02-28 15:00:00' AND '2011-03-30 15:00:00' | | |
+------------------------------------------------------------------------------------+ | |
| 0 | | |
+------------------------------------------------------------------------------------+ | |
1 row in set (0.00 sec) | |
mysql> SELECT CAST('2011-03-31' AS DATE) BETWEEN '2011-03-01' AND '2011-03-31'; |
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/bash | |
LOGDIR=/usr/local/nginx/logs | |
PID=/usr/local/nginx/logs/nginx.pid | |
NOW=$(date +%Y%m%d-%H%M%S) | |
cd ${LOGDIR} | |
for i in *.log; do | |
mv ${i} ${i}.tmp.${NOW} |
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
window.onload = function(){ | |
function Chart(table_elem, size, type) { | |
this.dom = table_elem; | |
this.size = size; | |
this.type = type | |
this.calc(); | |
} | |
Chart.prototype.rangechars = [ |
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 'securerandom' | |
require 'openssl' | |
require 'base62' # base62 gem | |
require 'benchmark' | |
module RandomString | |
class Concat |
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 'webrick' | |
require 'webrick/httpproxy' | |
require "pathname" | |
class Dumper | |
def initialize(dir) | |
@dir = dir | |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'active_support/all' | |
require 'open-uri' | |
require 'nokogiri' | |
require 'cgi' | |
require 'ir_b' | |
def parse(no, 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
#!/bin/sh | |
RAILS_ROOT=$(cd $(dirname $0)/..; pwd) | |
echo $RAILS_ROOT | |
cd $RAILS_ROOT | |
cp Gemfile Gemfile.$$ | |
echo "\ngem 'annotate'" >> Gemfile | |
bundle install |
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 | |
cd `dirname $0`/.. | |
OUTDIR=reports | |
OUTFILE=$OUTDIR/rails_best_practices.properties | |
TMPFILE=`mktemp $OUTDIR/rails_best_practices.XXXXXX` | |
mkdir $OUTDIR 2> /dev/null | |
rails_best_practices > $TMPFILE |
OlderNewer