Skip to content

Instantly share code, notes, and snippets.

View JuanitoFatas's full-sized avatar
🍔

Juanito Fatas JuanitoFatas

🍔
View GitHub Profile
@JuanitoFatas
JuanitoFatas / README.md
Created December 18, 2015 04:11 — forked from fnichol/README.md
A Common .ruby-version File For Ruby Projects

A Common .ruby-version File For Ruby Projects

Background

I've been using this technique in most of my Ruby projects lately where Ruby versions are required:

  • Create .rbenv-version containing the target Ruby using a definition name defined in ruby-build (example below). These strings are a proper subset of RVM Ruby string names so far...
  • Create .rvmrc (with rvm --create --rvmrc "1.9.3@myapp") and edit the environment_id= line to fetch the Ruby version from .rbenv-version (example below).

Today I learned about another Ruby manager, rbfu, where the author is using a similar technique with .rbfu-version.

@JuanitoFatas
JuanitoFatas / index.sh
Last active August 29, 2015 14:15 — forked from jlord/index.sh
for f in *.jpg; do
convert ./"$f" -gravity center -resize 1137 -extent 1137x640 -blur 0x4 ./finalcat/"new-$f"
convert ./finalcat/"new-$f" -page +248 ./"$f" -flatten ./finalcat/"new-$f"
done
# app/models/ability.rb
module Ability
class << self
def ability_for user, options = {}
abilities = AnonymousAbility.new
return abilities unless user
abilities.merge MemberAbility.new user, options

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

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

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 / .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"
@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 / README.md
Created September 16, 2013 06:44 — 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