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 |
desc "deploy", "deploys the site via LFTP to the location specified in the environment" | |
def deploy | |
load_ftp_configuration | |
start_timestamp = Time.now.to_i | |
if system("lftp -e 'mirror -R -v #{ENV['PUBLIC_DIRECTORY']} #{ENV['FTP_TARGET_DIRECTORY']}; bye' -u #{ENV['FTP_USER']},#{ENV['FTP_PASSWORD']} #{ENV['FTP_SERVER']}") | |
puts "Deploy finished. (Duration: #{Time.now.to_i - start_timestamp} seconds)" | |
else | |
puts 'Deploy aborted, something went wrong.' |
#!/bin/sh | |
set -e | |
function download() { | |
url=$1 | |
base=$(basename $1) | |
if [[ ! -e $base ]]; then | |
echo "curling $url" | |
curl -O -L $url |
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 |
#= require helpers/namespace | |
#= require embient/ember-routemanager | |
namespace 'slotcars' | |
slotcars.RouteManager = Ember.RouteManager.extend | |
wantsHistory: true # use html5 push state | |
delegate: null |
Slotcars::Application.routes.draw do | |
root :to => 'tracks#index' | |
get '/tracks/:id' => 'tracks#index' | |
get '/tracks/new' => 'tracks#index' | |
end |
canvas = document.getElementById 'canvas' | |
canvas.width = 1024 | |
canvas.height = 700 | |
context = canvas.getContext '2d' | |
points = [] | |
isMoving = false | |
$('canvas').on 'touchstart', (event) -> onTouchStart event | |
$('canvas').on 'touchmove', (event) -> onTouchMove event |
<html> | |
<head> | |
<title>CoffeeScript</title> | |
<script type="text/javascript" src="http://coffeescript.org/extras/coffee-script.js"></script> | |
</head> | |
<body> | |
<h1>Hello CoffeeScript!</h1> |
class User < ActiveRecord::Base | |
include Clearance::User | |
before_create :generate_api_key | |
attr_accessible :time_zone, :email, :password | |
validates_uniqueness_of :api_key | |
private | |
def generate_api_key | |
self.api_key = Digest::SHA1.hexdigest(Time.now.to_s + rand(12341234).to_s)[1..24] |
# test.coffee | |
Test = | |
print: -> | |
console.log("Test.print called") | |
if module.exports? | |
module.exports = Test | |
else | |
@Test = Test |
# RVM bootstrap | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) | |
require 'rvm/capistrano' | |
set :rvm_ruby_string, '1.9.2@shuffler' | |
set :rvm_type, :user | |
# bundler bootstrap | |
require 'bundler/capistrano' | |
unless Capistrano::CLI.ui.agree("Are you sure you want to redeploy? (yes/no): ") |