Skip to content

Instantly share code, notes, and snippets.

View kelby's full-sized avatar
💭
lalala...

kelby

💭
lalala...
View GitHub Profile
@kelby
kelby / How to use Backbone.js.md
Last active September 3, 2015 12:02 — forked from nightire/How to use Backbone.js.md
How to use Backbone.js

Simple Starting Point

创建 Model

var Person = Backbone.Model.extend();
@kelby
kelby / gist:42ad168ed948d966f3e1
Last active August 29, 2015 14:22
安装rvm, ruby, rails

对于新手来说,安装 rails 有时确实是一件痛苦的事。这也不懂,那也不懂。尽管网上这教程一搜一大把,但如何‘选择’又是另一个大问题。
网上教你如何安装 rails 的教程可以说数不胜数,这也只是其中这一,作者希望能够对你有帮助~~~

首先说明,这教程不适用于windows,作者本人在多个 Ubuntu 版本多次安装成功过,在 Mac 下更改部分命令仍然可用,其它 *inux ‘大同小异’。

第一步,打开终端 Ctrl+Alt+T。 然后升级一下源,执行:

sudo apt-get update 
zh-CN:
admin:
js:
true: 是的
false: 不是
is_present: 已经存在
is_blank: 不存在
date: 日期 ...
between_and_: 从 ... 到 ...
today: 今天
@kelby
kelby / authentications_controller.rb
Last active October 18, 2017 22:28
使用omniauth时的controller,这与devise里的omniauthable模块差不多。但实现手法又有一点不同,选择哪个,看情况吧。
class AuthenticationsController < Devise::OmniauthCallbacksController
before_action :create
def github
end
def create
puts "=== omniauth is: #{request.env["omniauth"]} ==="
puts "=== omniauth.auth is: #{request.env["omniauth.auth"]} ==="