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
@AdamBrodzinski
AdamBrodzinski / compass-retina-sprites.scss
Created August 10, 2012 00:17 — forked from thulstrup/compass-retina-sprites.scss
Using Compass to generate normal and retina sprite maps
@import "compass/utilities/sprites"; // Include compass sprite helpers
@import "compass/css3/background-size"; // Include helper to calc background size
@mixin sprite($name, $hover: false, $active: false) {
@include retina-sprite($name, $sprites, $sprites2x, $hover, $active);
}
// The general purpose retina sprite mixin.
//
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@ryanb
ryanb / abilities.rb
Created September 15, 2012 19:23
How you can break up large Ability class in CanCan
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end
@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
@yorkxin
yorkxin / README.md
Created December 14, 2012 07:45
Notes on Paul Irish's "Things I learned from the jQuery source" casts.

Notes on Paul Irish's "Things I learned from the jQuery source" casts

I watched these videos on 2012/12/14. Today's jQuery version is 1.8.3. So there might be some differences from the original video. I've briefly noted some of the differences between what described in the video and the current stable release. Most code he desribed can be found easily in speed/jquery-basic.js (1.4.2).

Episode 1

2010-06-14 (jQuery 1.4.1)

anonymous
anonymous / gist:4412635
Created December 30, 2012 12:35
# Extract Service Object

英文

  1. I quit! 我不干了!
  2. Let go! 放手!
  3. So long.再見。
  4. Allow me.讓我來。
  5. Cheer up! 振作起來!
  6. My treat.我請客。
  7. So do I.我也一樣。
  8. This way。這邊請。

Security is Hard

Massive Assignment

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

Admin

淡入 一群身著制服,表情嚴肅的軍官。)

會議桌的主位上,一位資深高階 將軍 正在說話。

將軍:報告已經證實了,紐約市已經…被殭屍占領了。

上校:又來了?明明 28 天前才發生過一次殭屍入侵!

將軍:這些僵屍…不一樣。它們是… 哲學 僵屍。

@wildjcrt
wildjcrt / check_bot.rb
Created August 6, 2013 16:18
自動檢查 registrano 報名資訊,讓我在 10 小時前成功加入台灣零時政府第壹次公地放領黑客松的小程式。
# encoding: utf-8
# $ ruby check_bot.rb
require 'open-uri'
@url = 'https://registrano.com/events/handlino-new-opening/registrations/new'
def check?
open(@url) do |f|
f.each_line do |line|
if line.include? '抱歉,目前本活動已額滿。'