Skip to content

Instantly share code, notes, and snippets.

View piersadrian's full-sized avatar

Piers Mainwaring piersadrian

View GitHub Profile
@piersadrian
piersadrian / index.jade
Created February 26, 2014 19:04
yeoman, bower, h5bp, angular-compatible index.jade
doctype html
| <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
| <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
| <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
| <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
head
meta(charset='utf-8')
meta(http-equiv='X-UA-Compatible', content='IE=edge')
title
meta(name='description', content='')
@piersadrian
piersadrian / Gruntfile.js
Last active August 29, 2015 13:56
Gruntfile with coffeescript, rails proxy, and jade
// Generated on 2014-02-26 using generator-angular 0.7.1
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
'use strict'
app = angular.module('ngContentApp')
class BaseCtrl
@$inject: ['$scope', '$location', '$route']
constructor: (dependencies...) ->
# Construct a map of injected dependencies.
deps = {}
'use strict';
var BaseCtrl, ConditionEditCtrl, ConditionsListCtrl, EditCtrl, app,
__slice = [].slice,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
app = angular.module('ngContentApp');
BaseCtrl = (function() {
@import "ui-variables";
@import "syntax-variables";
@line-background-color: #f2faff;
.editor:not(.mini) {
width: 1100px;
margin: 40px auto;
.gutter {
@piersadrian
piersadrian / gitsync.sh
Created December 14, 2011 21:54
Automating Git with Gitsync
#!/bin/bash
# Gitsync sychronizes Git's origin repository to the local copy by
# first fetching all changes, presenting a simple diff of the changes,
# then asking for confirmation before merging the changes into the
# local branch and pushing changes.
#
# Thanks to Aaron Crane (http://aaroncrane.co.uk/2009/03/git_branch_prompt/)
#
# Author: Piers Mainwaring.
# License: Public Domain (no rights reserved)
#! /usr/bin/env python
import fileinput
import argparse
from operator import itemgetter
parser = argparse.ArgumentParser()
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int)
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+')
args = parser.parse_args()
@piersadrian
piersadrian / cookie_jar_fix.gemspec
Created November 5, 2012 18:08 — forked from jodosha/cookie_jar_fix.gemspec
Support cookie jar options for all cookie stores
@piersadrian
piersadrian / unicorn.rb
Created November 19, 2012 04:37 — forked from jamiew/unicorn.rb
Unicorn config for use with bundler and capistrano - fixes issues with environment pollution.rb
# My pimped out unicorn config, with incremental killof
# and all the latest capistrano & bundler-proofing
# @jamiew :: http://github.com/jamiew
application = "000000book.com"
environment = ENV['RACK_ENV'] || ENV['RAILS_ENV'] || 'production'
app_path = "/srv/#{application}"
bundle_path = "#{app_path}/shared/bundle"
timeout 30