Skip to content

Instantly share code, notes, and snippets.

View JuanitoFatas's full-sized avatar
🐻
Buildkite Engineering

Juanito JuanitoFatas

🐻
Buildkite Engineering
View GitHub Profile
@JuanitoFatas
JuanitoFatas / README.md
Created September 16, 2013 06:46 — forked from yorkxin/README.md

html-pipeline: 把 text formatting 做成一層一層的 filter 接成 pipeline

linguist: 自動偵測一段文本或檔案的程式語言, GitHub 本身用它來偵測你專案使用的程式語言

charlock_holmes: 自動偵測文本的文字編碼,來自一個叫做 ICU 的資料庫,不知道是什麼,搜集了一堆文字編碼資訊和地區格式。

github-markdown: 實際在 GitHub 使用的 markdown compiler ,我找不到公開的 repo ,但程式碼是 MIT license ,很神秘…

github-markup: 用來把 README.md 這種檔案給 render 成 HTML

@JuanitoFatas
JuanitoFatas / .bash_profile
Created September 28, 2013 07:05
my bash_profile
# Terminal Colour
export TERM=xterm-256color
export LSCOLORS="exfxcxdxbxegedabagacad"
export CLICOLOR=1
export LANG="zh_TW.utf-8"
export LC_ALL="zh_TW.utf-8"
# Set up Safari for development.
@JuanitoFatas
JuanitoFatas / gem-update-log.md
Created October 15, 2013 02:18
Gem Update log

Gem Update log

$ gem update --system
Updating rubygems-update
Fetching: rubygems-update-2.1.9.gem (100%)
Successfully installed rubygems-update-2.1.9
Installing RubyGems 2.1.9
RubyGems 2.1.9 installed
@JuanitoFatas
JuanitoFatas / as-callback.rb
Created December 1, 2013 14:58
Active Support Callbacks
require 'active_support'
class Record
include ActiveSupport::Callbacks
define_callbacks :save
def save
run_callbacks :save do
puts "save!"
end
@JuanitoFatas
JuanitoFatas / .zshrc
Created December 9, 2013 05:31 — forked from yorkxin/.zshrc
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
#ZSH_THEME="yaci"
ZSH_THEME="yaci-agnoster"

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

@JuanitoFatas
JuanitoFatas / gist:9951004
Created April 3, 2014 09:03
stty raw -echo
raw (-raw) If set, change the modes of the terminal so that no input or
output processing is performed. If unset, change the modes
of the terminal to some reasonable state that performs input
and output processing. Note that since the terminal driver
no longer has a single RAW bit, it is not possible to intuit
what flags were set prior to setting raw. This means that
unsetting raw may not put back all the setting that were pre-
viously in effect. To set the terminal into a raw state and
then accurately restore it, the following shell code is rec-
ommended:
require 'active_record'
ActiveRecord::Base.establish_connection adapter: "sqlite3", database: ":memory:"
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :users do |t|
t.timestamps
end
create_table :activities do |t|
t.integer :user_id
@JuanitoFatas
JuanitoFatas / activerecord-14841.rb
Created April 23, 2014 03:25
Active Record no_touching should bypass after_touch callback. rails/rails #14841
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@JuanitoFatas
JuanitoFatas / edge-rails-app.md
Last active August 29, 2015 14:02
Create Edge Rails application

Clone rails/rails repo.

cd into it, ruby install.rb LATEST_VERSION to install edge rails.

Use this installed rails executeable to generate new project but with --skip-bundle option:

rails new app --skip-bundle.

cd to newly generated app, change the rails line and add arel: