Skip to content

Instantly share code, notes, and snippets.

@SammyLin
SammyLin / Gemfile
Last active December 17, 2015 13:29
My default Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.13'
gem 'jquery-rails'
# A Scope & Engine based, clean, powerful, customizable and sophisticated paginator
gem "kaminari"
# Compass is a Stylesheet Authoring Environment that makes your website design simpler to implement and easier to maintain.
class config::sublime {
define addpkg {
$packagedir = "/Library/Application Support/Sublime Text 2/Packages/"
$pkgarray = split($name, '[/]')
$pkgname = $pkgarray[1]
exec { "git clone https://github.com/${name}.git":
cwd => "/Users/${::luser}${packagedir}",
provider => 'shell',
@mriddle
mriddle / sublime_config.pp
Last active August 21, 2018 22:06
My Boxen puppet-sublime config
class config::sublime {
define addpkg {
$packagedir = "/Library/Application Support/Sublime Text 2/Packages/"
$pkgarray = split($name, '[/]')
$pkgname = $pkgarray[1]
exec { "git clone https://github.com/${name}.git":
cwd => "/Users/${::luser}${packagedir}",
provider => 'shell',
#!/bin/sh
# Just copy and paste the lines below (all at once, it won't work line by line!)
# MAKE SURE YOU ARE HAPPY WITH WHAT IT DOES FIRST! THERE IS NO WARRANTY!
function abort {
echo "$1"
exit 1
}
set -e

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
<input type="button" onclick="(function(btn){var z=document.createElement('script');document.subtomeBtn=btn;z.src='https://www.subtome.com/load.js';document.body.appendChild(z);})(this)" value="Subscribe">
@sosiouxme
sosiouxme / kick.sh
Created November 11, 2012 06:34 — forked from Miciah/kick.sh
OpenShift kickstart script (using beta packages)
#!/bin/sh
# This is a sample script for kickstarting a VM according to the openshift.ks script under virt-manager, qemu+KVM, and Linux.
# You certainly need to modify at least the CMDLINE and --location below for it to be useful (unless you work at Red Hat).
set -e
if [ $# -lt 1 ]
then
printf 'Usage: %s vm_name [arg1 [arg2 [...]]]\n' "$0"
@zhiyao
zhiyao / Heroku db task
Created October 30, 2012 16:10
Heroku database backup, transfer between production and staging server, alot faster that the heroku db:pull and db:push. This will only work if your local app is setup with postgres database
#!/usr/bin/env ruby
#Place this in your root directory of your rails app
#Ensure that you have install thor gem
#To list the command, type 'thor -T'
module Heroku
class Db < Thor
desc "production_to_local", "clone a remote heroku database to the local environment"
method_option :remote_production, :type => :string, :default => 'production'
@olistik
olistik / gist:3894072
Created October 15, 2012 18:09
Ubuntu 12.04 Terminator config: solarized theme + iTerm2-like key bindings
# place this file in ~/.config/terminator/config
[global_config]
title_transmit_bg_color = "#d30102"
focus = system
[keybindings]
reset_clear = <Ctrl>R
new_tab = <Ctrl>T
split_horiz = <Ctrl><Shift>E
split_vert = <Ctrl>E
close_term = <Ctrl><Shift>W
Spree::Order.class_eval do
silence_warnings do
state_machines.clear
#override state_machine to add choose_reward step
state_machine :initial => 'cart', :use_transactions => false do
event :next do
transition :from => 'cart', :to => 'address'
transition :from => 'address', :to => 'delivery'
transition :from => 'delivery', :to => 'payment', :if => :payment_required?
transition :from => 'delivery', :to => 'complete'