Skip to content

Instantly share code, notes, and snippets.

View nicholasklick's full-sized avatar

nicholasklick

View GitHub Profile

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
Highcharts.Chart.prototype.callbacks.push(function(chart) {
var hasTouch = document.documentElement.ontouchstart !== undefined,
mouseTracker = chart.pointer,
container = chart.container,
mouseMove;
mouseMove = function (e) {
// let the system handle multitouch operations like two finger scroll
// and pinching
require 'formula'
class Pdftk < Formula
url 'http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk-1.44-src.zip'
homepage 'http://www.pdflabs.com/'
md5 '9eb50fffcd621a627d387750c60982b4'
depends_on 'gcc' # with "--enable-java" option , required "Homebrew-alt" .
# via : https://github.com/adamv/homebrew-alt/
def install
1. vagrant up
2. knife solo bootstrap -p 2222 vagrant@localhost
3. ssh -p 2222 deploy@localhost
4. cap deploy:setup BRANCH=branch_name HOST=localhost:2222
5. knife solo cook deploy@localhost -p 2222
# Here's a sequence of numbers where each line is
# generated by semantically counting and printing the numbers
# in the previous line:
#
# 1
# 11
# 21
# 1211
# 111221
# 312211
#!/bin/bash
if [ -z "$1" ]; then
wdir="."
else
wdir=$1
fi
for f in $( find . -name '*erb' ); do
out="${f%.erb}.haml"
if [ -e $out ]; then
# /etc/init/project-web-reload.conf
pre-start script
initctl restart project-web
sleep 15
end script
exec /usr/local/rvm/bin/default_bluepill restart
#
# = ostruct.rb: OpenStruct implementation
#
# Author:: Yukihiro Matsumoto
# Documentation:: Gavin Sinclair
#
# OpenStruct allows the creation of data objects with arbitrary attributes.
# See OpenStruct for an example.
#
@nicholasklick
nicholasklick / chef-solo-vagrant-berkshelf.sh
Last active August 29, 2015 14:04
Sets up a basic install of Chef solo, vagrant and berkshelf
# =====================
# INITIAL PROJECT SETUP
# =====================
#
# Create basic project directory
mkdir try-chef
cd try-chef
#
@nicholasklick
nicholasklick / spec_helper.rb
Created December 14, 2015 15:34 — forked from andreypronin/spec_helper.rb
RSpec hooks I use with DatabaseCleaner. We can't use transactional fixtures with Selenium/Poltergeist, but it's an overkill to truncate/delete for non-JS specs. Thus this optimization here. Read more at http://railscasts.com/episodes/257-request-specs-and-capybara. Assumption (just in case): only javascript_driver is set to Poltergeist/Selenium …
config.use_transactional_fixtures = false
config.before(:suite) do
# Do truncation once per suite to vacuum for Postgres
DatabaseCleaner.clean_with :truncation
# Normally do transactions-based cleanup
DatabaseCleaner.strategy = :transaction
end
config.around(:each) do |spec|