Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| CREATE TABLE `user` ( | |
| `twitter_id` int(10) unsigned NOT NULL, | |
| `created_at` timestamp NOT NULL default '0000-00-00 00:00:00', | |
| `name` varchar(80) NOT NULL, | |
| `screen_name` varchar(30) NOT NULL, | |
| `location` varchar(120) default NULL, | |
| `description` varchar(640) default NULL, | |
| `profile_image_url` varchar(400) NOT NULL, | |
| `url` varchar(100) default NULL, |
| ruby -e 'puts "#{1.size * 8} bits"' |
| twitter model validation and notes | |
| username: max length 15 | |
| real name: max length 20 (first + last) | |
| required field on new account creation(by this order): | |
| real name | |
| password | |
| username |
| task :deploy => ['deploy:push', 'deploy:restart', 'deploy:tag'] | |
| namespace :deploy do | |
| task :migrations => [:push, :off, :migrate, :restart, :on, :tag] | |
| task :rollback => [:off, :push_previous, :restart, :on] | |
| task :push do | |
| puts 'Deploying site to Heroku ...' | |
| puts `git push heroku` | |
| end |
| curl -i -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"score":{"comment":"Changed"}}' http://localhost:3000/scores/908005739.json |
| pt: | |
| errors: | |
| messages: | |
| not_found: "não encontrado" | |
| already_confirmed: "já foi confirmado" | |
| not_locked: "não foi bloequeado" | |
| devise: | |
| failure: | |
| unauthenticated: 'Para continuar, deve fazer login ou registrar-se.' |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
| Ctrl+C | copy current line (if no selection) |
| Ctrl+X | cut current line (if no selection) |
| Ctrl+⇧+K | delete line |
| Ctrl+↩ | insert line after |
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| [ -z "$PS1" ] && return | |
| # don't put duplicate lines in the history. See bash(1) for more options | |
| # ... or force ignoredups and ignorespace | |
| HISTCONTROL=ignoredups:ignorespace |
| require 'benchmark' | |
| def is_it_true? | |
| true | |
| end | |
| CONSTANT = 1 | |
| BenchTimes = 1_000_000 | |
| Benchmark.bm(20) do |bm| |
| directory "tmp" | |
| file "tmp/hello.tmp" => "tmp" do | |
| sh "echo 'Hello' > 'tmp/hello.tmp'" | |
| end | |
| task :default => 'morning:turn_off_alarm' | |
| namespace :morning do | |
| desc "Turn off alarm." |