This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # lib/omniauth/facebook.rb | |
| require 'httparty' | |
| module Omniauth | |
| class Facebook | |
| include HTTParty | |
| # The base uri for facebook graph API | |
| base_uri 'https://graph.facebook.com/v2.3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ######################### | |
| # config/initializers/doorkeeper.rb | |
| ######################### | |
| Doorkeeper.configure do | |
| # Change the ORM that doorkeeper will use. | |
| # Currently supported options are :active_record, :mongoid2, :mongoid3, :mongo_mapper | |
| orm :active_record | |
| # This block will be called to check whether the resource owner is authenticated or not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| HTTP status code symbols for Rails | |
| Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
| Status Code Symbol | |
| 1xx Informational | |
| 100 :continue | |
| 101 :switching_protocols | |
| 102 :processing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem 'devise', '3.2.4' | |
| gem 'simple_token_authentication', '1.5.0' |
People
:bowtie: |
π :smile: |
π :laughing: |
|---|---|---|
π :blush: |
π :smiley: |
:relaxed: |
π :smirk: |
π :heart_eyes: |
π :kissing_heart: |
π :kissing_closed_eyes: |
π³ :flushed: |
π :relieved: |
π :satisfied: |
π :grin: |
π :wink: |
π :stuck_out_tongue_winking_eye: |
π :stuck_out_tongue_closed_eyes: |
π :grinning: |
π :kissing: |
π :kissing_smiling_eyes: |
π :stuck_out_tongue: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Syntax sugar | |
| class ArrayValidator < EnumValidator | |
| end |
So, you've merged the master branch with itself, and you ended up with a merge commit nobody wanted.
John and Pete are working together on a repo.
$ git log --graph --pretty=oneline --abbrev-commit # an alias I have under 'git lol', but 'gitk' does just fine
* 812492b (master, origin/master, origin/HEAD) Add stuff
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def paginate(scope, default_per_page = 20) | |
| collection = scope.page(params[:page]).per((params[:per_page] || default_per_page).to_i) | |
| current, total, per_page = collection.current_page, collection.num_pages, collection.limit_value | |
| return [{ | |
| pagination: { | |
| current: current, | |
| previous: (current > 1 ? (current - 1) : nil), | |
| next: (current == total ? nil : (current + 1)), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # no config | |
| Time.now is localtime | |
| 1.second.from_now is UTC | |
| Timestamp stored in UTC | |
| AR not translated | |
| Time.now: Fri Aug 24 10:22:25 +0930 2012 | |
| 1.second.from_now 2012-08-24 00:52:26 UTC |

