Skip to content

Instantly share code, notes, and snippets.

View wildjcrt's full-sized avatar
🦀
have a nice day!

Jerry Lee wildjcrt

🦀
have a nice day!
View GitHub Profile
@wildjcrt
wildjcrt / gist:2246377
Created March 30, 2012 04:01 — forked from Truesun/html
test
<body style="color:#fff; font-family:Verdana, Geneva, sans-serif;">
<h3 style="font-weight:bold; font-size:13px; border-bottom:solid 1px #eee; padding:2px 0;">名稱:測試投票</h3>
<p style="margin-bottom:8px; padding:5px 0;">
宗旨:com'ono<br>
此次投票你可以投 <span id="remain-votes">2</span> 票。
</p>
<div class="grid">
<ul style="padding:0 0 0 5px; margin-bottom:8px;">
<li><input name="" value="" type="checkbox"> a</li>
<li><input name="" value="" type="checkbox"> bcd</li>
@wildjcrt
wildjcrt / hack.sh
Created April 11, 2012 06:52 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#

開源之道

Original transcript: http://allisonrandal.com/2012/04/15/open-source-enlightenment/

這幾年來,我慢慢覺得,我們參與開源社群,就像是在一條道路上並肩而行:這不僅讓我們成為更好的程式設計者,也讓我們通過與人合作,而成為更好的人。

您可以將它想成一條修行之道,讓身而為人的我們能夠不斷成長。接下來,我想談談我對開源世界的個人觀點,希望能與您分享。

首先,人是一切開源專案的核心。程式碼是很重要,但最核心的永遠是人。

# Home
桌子:IKEA GALANT http://www.ikea.com/tw/zh/catalog/products/S59885197/
電腦:iMac 27" i5 8G ram
鍵盤: Filco 茶軸
滑鼠:Magic Mouse
滑鼠墊:eZova
耳機: QC15
椅子: Aeron
@wildjcrt
wildjcrt / progress_indicators.rb
Created August 3, 2012 23:50 — forked from jpo/progress_indicators.rb
Ruby Progress Indicators
# Terminal Progress Indicators. Four examples are included: percentage,
# spinner, progress bar, and combined. This script has been tested on
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3
class Spinner
include Enumerable
def each
loop do
yield '|'
yield '/'
@wildjcrt
wildjcrt / deploy.rb
Created November 9, 2012 17:14 — forked from ayamomiji/deploy.rb
My capistrano + rainbows configure
# Check if remote file exists
def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end
# Check if process is running
def remote_process_exists?(pid_file)
capture("ps -p $(cat #{pid_file}) ; true").strip.split("\n").size == 2
end
@wildjcrt
wildjcrt / _test.rb
Created November 21, 2012 11:52 — forked from jcoglan/_test.rb
$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do

Security is Hard

Massive Assignment

  • watch for ActiveRecord Relation, like has_many, has_many :through
  • watch for user_roles, `group_users
  • UPDATE action

Admin

@wildjcrt
wildjcrt / test.rb
Created June 25, 2014 01:16 — forked from tka/test.rb
sql = "select *, (select count(books.id) from books where books.authorsid=authors.id) as books_count from authors "
authors = Author.find_by_sql(sql)
authors.first.books_count
@wildjcrt
wildjcrt / 0_reuse_code.js
Last active August 29, 2015 14:10
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console