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 / x-setup.txt
Created April 28, 2012 04:35
X项目配置
rvm gemset create rails-x
gem install rails -v 3.2.3
rails new x_weibo --skip-test-unit --skip-bundle
;;; Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'pg', '0.12.2'
@JuanitoFatas
JuanitoFatas / saludos.md
Created June 9, 2012 07:30
西文一些結尾問候語的說法

一些禮貌性的結尾問候語:

  • un beso (A kiss)
  • un besote (A big kiss)
  • un besazo (A big big kiss)
  • un besito (小親親,有那種親小孩的感覺,啾啾啾的那種親親)
  • un besico (跟besito一樣,但是妳如果跟從 zaragoza 來的人,說besico,他們會很驚訝喔!!)
  • un besiko (跟besico一樣,只是 k 的音跟 c 一樣。)

-ito -ico 字根 就是變小的意思

++++++++++[>+++++>+++++++++>++++++++++>+<<<<-]>>>+++++++.<+++++++.>+++++++++.<++++.+++.>+.<-------.>-------.<++++++.<--.+++.-.--.++++++++++++++++.>.++++++.------------.++++++++.+++.<------------------.>---------.++++++++++++.--.
@JuanitoFatas
JuanitoFatas / factorial.lisp
Created June 27, 2013 06:53
Common Lisp 代碼例子:Factorial
(defun factorial (n)
(declare (optimize speed))
(labels ((fact (n acc)
(declare (type fixnum n)
(type bignum acc))
(if (<= n 0)
acc
(fact (the fixnum (1- n))
(the bignum (* n acc))))))
(fact n 1)))

Routes

小心地使用 Match(Rails 3 已实现)

Rails 3 提供了 match 方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:

注:(r3 代表 Rails 3,r4 代表 Rails 4)

# routes.rb

Routes

小心地使用 Match(Rails 3 已實現)

Rails 3 提供了match 方法供我們自定義routes,然而我們要小心使用它以避免“跨站腳本攻擊”(XSS Attack)。比如像這樣的 routes:

注:(r3 代表Rails 3,r4 代表Rails 4)

# routes.rb

Routes

小心地使用 Match(Rails 3 已实现)

Rails 3 提供了 match 方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:

注:(r3 代表 Rails 3,r4 代表 Rails 4)

# routes.rb
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@JuanitoFatas
JuanitoFatas / emojis.rb
Created September 12, 2013 15:50
Complete GitHub Emojis!!! <3 <3 <3
GITHUB_EMOJIS=
[
":bowtie:",
":smile:",
":laughing:",
":blush:",
":smiley:",
":relaxed:",
":smirk:",
":heart_eyes:",
@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