Skip to content

Instantly share code, notes, and snippets.

View JuanitoFatas's full-sized avatar
🍔

Juanito Fatas JuanitoFatas

🍔
View GitHub Profile
@JuanitoFatas
JuanitoFatas / 無用知識的有用性.md
Created June 30, 2013 06:34
無用知識的有用性

无用知识的有用性

弗莱克斯纳

[按] 30年代美国普林斯顿大学校长亚伯拉罕·弗莱克斯纳(Abraham Flexner)教授曾以 “无用知识的有用性”为题,发表过一篇在科学界有影响的文章。该文章强调了基础研 究以及自由探索的重要性。全文一万余字,现节译如下,以餐读者。

  智力与精神生活在表面上是一种无用型活动。人们之所以大量从事这种活动,是因

@JuanitoFatas
JuanitoFatas / build.yml
Last active February 26, 2020 07:32
Example GitHub Actions configurations for a Rails app
# .github/workflows/build.yml
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
env:
RAILS_ENV: test
@JuanitoFatas
JuanitoFatas / rails-diff.sublime-snippet
Created April 13, 2016 07:39
Generate rails old_version..new_version diff sublime snippet
<snippet>
<content><![CDATA[
Upgrade rails from ${1:old_version} to ${2:new_version}.
- Updated: [rails](http://github.com/rails/rails), [${1:old_version}...${2:new_version}](https://github.com/rails/rails/compare/v${1:old_version}...v${2:new_version})
- Updated: actionmailer, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionmailer/CHANGELOG.md))
- Updated: actionpack, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionpack/CHANGELOG.md))
- Updated: actionview, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/actionview/CHANGELOG.md))
- Updated: activejob, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activejob/CHANGELOG.md))
- Updated: activemodel, ${1:old_version}...${2:new_version} ([CHANGELOG](https://github.com/rails/rails/blob/v${2:new_version}/activemodel/CHANGELOG.md))
@JuanitoFatas
JuanitoFatas / .travis.yml
Last active January 7, 2016 14:08
Sample travis.yml for RubyGems.
language: ruby
bundler_args: --retry=3 --jobs=3
cache: bundler
sudo: false
rvm:
- 2.3
- 2.2
- 2.1
- 2.0
- 1.9.3

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 / 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 / cn.html
Created November 3, 2013 09:00
Countries for Devs (China)
<!--HTML-->
<select>
<option value="Beijing Provincial">Beijing Provincial</option>
<option value="Chongqing Provincial">Chongqing Provincial</option>
<option value="Shanghai Provincial">Shanghai Provincial</option>
<option value="Tianjin Provincial">Tianjin Provincial</option>
<option value="Hong Kong Provincial">Hong Kong Provincial</option>
<option value="Macau Provincial">Macau Provincial</option>
<option value="Anqing Prefectural">Anqing Prefectural</option>
<option value="Bengbu Prefectural">Bengbu Prefectural</option>
@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 / deppbot.md
Last active December 25, 2015 02:45
What is www.deppbot.com? Why bundle update?