- rails new
- " -T "
- " -d "
- locale files
- curl -L https://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/zh-CN.yml > config/locales/defaults.zh-CN.yml
-
- mongoid locale
- readme
- Gemfile
- haml
- rspec
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
| # Usage: redis-cli publish message hello | |
| require 'sinatra' | |
| require 'redis' | |
| conns = [] | |
| get '/' do | |
| erb :index | |
| end |
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
| <?php | |
| require 'google-api/apiClient.php'; | |
| require 'google-api/contrib/apiOauth2Service.php'; | |
| require 'google-api/contrib/apiDriveService.php'; | |
| $pdfFile = 'test.pdf'; | |
| // API Console: https://code.google.com/apis/console/ | |
| // Create an API project ("web applications") and put the client id and client secret in config.ini. |
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
| # Originally from http://bit.ly/GIhZmg | |
| # modified by @colour to reflect locations of assets in the asset pipeline | |
| namespace :spec do | |
| desc "Add files that DHH doesn't consider to be 'code' to stats" | |
| task :statsetup do | |
| require 'rails/code_statistics' | |
| class CodeStatistics | |
| alias calculate_statistics_orig calculate_statistics |
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
| Markdown Syntax: | |
| 1.Phrase Emphasis 斜体与加粗 | |
| *italic* **bold** | |
| _italic_ __bold__ | |
| 2.Links 超链接 |
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
| /** | |
| * Pure CSS magic line system | |
| * Inspiration: http://css-tricks.com/jquery-magicline-navigation/ | |
| * This is a WIP. | |
| */ | |
| a:link, a:visited { | |
| color:black; | |
| text-decoration:none; | |
| } | |
| a:hover ~ .magicline { |
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
| <?php | |
| /* | |
| * This class will give us a simple interface to interact with Datatables | |
| * | |
| * Meant to work with Datatables v1.9 | |
| * | |
| * DO NOT FORGET TO ADD A GET() METHOD TO YOUR ENTITIES... | |
| * |
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
| alias server='open http://localhost:8000 && python -m SimpleHTTPServer' |
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
| module Todo | |
| class API < Grape::API | |
| use Rack::Session::Cookie | |
| version 'v1', :format => :json | |
| helpers do | |
| def current_user | |
| return nil if env['rack.session'][:user_id].nil? | |
| @current_user ||= User.get(env['rack.session'][:user_id]) | |
| end |