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
found_records = [] | |
ActiveRecord::Base.connection.tables.each do |table| | |
klass = table.classify.constantize rescue next | |
klass.send(:columns).select{|col| col.type == :string}.collect(&:name).each do |column| | |
res = klass.all(:conditions => ["`#{table}`.#{column} like ?", "%bocrgk%"]) | |
found_records << res if res.any? | |
end | |
end | |
p found_records |
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
# get the image width and height for a remote image | |
require 'rubygems' | |
require 'open-uri' | |
require 'RMagick' | |
class RemoteImage | |
def initialize(path) | |
@image = Magick::ImageList.new.from_blob(open(path).read) | |
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
require 'rubygems' | |
require 'active_record' | |
ActiveRecord::Base.establish_connection( | |
:adapter => 'mysql', | |
:database => 'database', | |
:username => 'username', | |
:password => 'password', | |
:host => 'localhost' | |
:encoding => "utf8" |
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
# user and group to run as | |
user www www; | |
# pid of nginx master process | |
pid /var/run/nginx.pid; | |
# number of nginx workers | |
worker_processes 6; | |
# Number of worker connections. 1024 is a good default |
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
* div { zoom:1; } | |
.frame { | |
background-image:none; | |
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale, src='images/bg.png'); | |
} | |
.frame .content { | |
overflow:hidden; | |
position:relative; |
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
// toggle opacity for jQuery. toggles opacity between 1.0 and the specified value. | |
// | |
// usage: | |
// | |
// jQuery(selectory).toggleOpacity(); | |
// jQuery(selectory).toggleOpacity({speed:"slow"}); | |
// | |
// | |
// http://drawohara.com/post/205626543/jquery-toggleopacity | |
jQuery.fn.extend({ |
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
// Zoom | |
// | |
// Proportionnaly update font size | |
// | |
// Usage : | |
// $(document).ready(function () { | |
// $("#zoom-in").zoom("#to-zoom", 1.25); | |
// $("#zoom-out").zoom("#to-zoom", 0.8); | |
// }); | |
// |
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 | |
# ex : | |
# xslt.sh -IN foo.xml -XSL foo.xsl -OUT foo.out | |
# => java -classpath $XALAN_PATH org.apache.xalan.xslt.Process -IN foo.xml -XSL foo.xsl -OUT foo.out | |
XALAN_PATH="$HOME/lib/xalan-j_2_7_1/" | |
java -classpath $XALAN_PATH org.apache.xalan.xslt.Process $* |
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 lua | |
-- This program aims to compress too big image when they are uploded | |
-- A directory and every subdirectories are watched via lua inotify binding : | |
-- http://github.com/hoelzro/linotify/ | |
-- | |
-- | |
-- | |
-- | |
-- Requirements : |
OlderNewer