Skip to content

Instantly share code, notes, and snippets.

View zph's full-sized avatar

Zander Hill zph

View GitHub Profile
#!/usr/bin/env ruby
# Copyright (c) 2013-4 Virtual Hold Technology. All Rights Reserved.
$: << File.expand_path(File.join(File.dirname(__FILE__), '../lib'))
require 'rubygems'
require 'configliere'
require 'concurrent'
require 'pp'
require 'sinatra'
module Sinatra
module Templates
@@last_render = {}
alias_method :orig_render, :render
def render(engine, data, options={}, locals={}, &block)
@@last_render[:engine] = engine
@@last_render[:data] = data
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.

This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)

You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)

If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.

Note that this is not specific to Rails projects. This can work for any standalone front-end project.

Instructions

@zph
zph / log.txt
Created November 5, 2013 15:50 — forked from mislav/log.txt
480 git commit -v
397 git status -sb
120 git add -p
53 git push
52 git diff
47 noglob bundle exec
45 ls -G
45 git branch -v
45 bundle
39 git push -u
@zph
zph / gitcommit
Created September 24, 2013 17:55 — forked from sbrauer/gitcommit
#!/usr/bin/env ruby
# A wrapper around "git commit" that provides a template message
# conforming to RentPath conventions.
# Assumes branches are named with the following components separated
# by underscores:
# 1. developer initials (one or more of these components are allowed)
# 2. story number
# 3. free text description (optional; may contain underscores)
# Examples:
# "sb_12345_fix_serious_bug"
@zph
zph / _readme.md
Created August 19, 2013 18:41 — forked from mislav/_readme.md

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@zph
zph / bob.rb
Created August 14, 2013 13:53 — forked from rlb3/bob.rb
require 'ripper'
def Object.const_missing(name)
klass = const_set name, Class.new
klass.class_eval do
def method_missing name, *args
file, line_num, _ = caller[0].split(':')
file_contents = File.open(file).read

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.

#!/bin/sh
SPACE="SERVER$(spacefinder | sed 's/Current Space ID: //')"
mvim --serverlist | grep $SPACE
if [ $? -eq 1 ]
then
mvim --servername $SPACE $*
else
mvim --servername $SPACE --remote $*
fi