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
# To fix: | |
# LoadError: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib | |
# Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle | |
# Reason: image not found – /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle | |
# from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle | |
# from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’ | |
# from /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2.rb:7 | |
# from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require’ | |
# from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require’ | |
# from (irb):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
require 'daemons' | |
Daemons.run('./proxy.rb') |
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 /path/to/dir -type f -print0 | xargs -I {} -0 chmod 0644 {} | |
$ find /path/to/dir -type d -print0 | xargs -I {} -0 chmod 0755 {} |
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
class Data | |
attr_accessor :date_range | |
def initialize(type) | |
@type = type | |
end | |
def graph_points | |
SomeClass.graph_points( | |
@type, |
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
module Memoize | |
def remember(klass, method_name) | |
klass.class_eval do | |
memory = $redis | |
original = "original_#{method_name}" | |
original_method = method(method_name) | |
define_singleton_method(method_name) do |*args| |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script> | |
window.onload = function() { | |
// Must be server-side images; non-origin images will result in a security exception | |
var images = ["img.jpg"]; | |
for (var i=0;i<images.length;i++) { | |
thumbnailify(images[i]); |
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
rails4(){ /PARENT_PATH_TO_RAILS/rails/railties/bin/rails "$@" ; } |
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
$(document).on 'click', 'form .remove_fields', (event) -> | |
$(this).prev('input[type=hidden]').val('1') | |
$(this).closest('fieldset').hide() | |
event.preventDefault() | |
$(document).on 'click', 'form .add_fields', (event) -> | |
time = new Date().getTime() | |
regexp = new RegExp($(this).data('id'), 'g') | |
$(this).before($(this).data('fields').replace(regexp, time)) | |
event.preventDefault() |
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
.table-view { | |
width:100%; | |
height:100%; | |
overflow:scroll; | |
} | |
.table-view-cell{ | |
width:100%; | |
height:30px; | |
border: 1px solid #c0c0c0; | |
cursor: pointer; |