Skip to content

Instantly share code, notes, and snippets.

@serby
serby / commit-style-guide.md
Last active August 29, 2015 14:00
Clock Commit Style Guide

Clock Committing Style Guide

To allow us to automatically create a good quality changelog from our git history we recommend the following formats for commit messages.

The aim is to capture a reference to any ticket, card, or story that this commit contributes towards.

Because we are now using the Pivotal Tracker Webhook on some projects we suggest wrapping your commit message prefix with square brackets []

http://pivotallabs.com/level-up-your-development-workflow-with-github-pivotal-tracker/

@domharrington
domharrington / .mongorc.js
Created December 5, 2014 11:38
.mongorc.js file
DBCollection.prototype.read = function (id) {
return this.findOne({ _id: ObjectId(id) })
}
DBCollection.prototype.delete = function (id) {
return this.remove({ _id: ObjectId(id) })
}
function notablescan() {
var currentValue = db.getSiblingDB('admin').runCommand({ getParameter: 1, notablescan: 1 }).notablescan
@balaclark
balaclark / min.rb
Created June 18, 2010 10:50
Command line script to compress & combine javascript files using the google closure compiler. "sources" needs to be a plain text file with urls of each javascript file to compress on a new line, comments are fine.
require 'rubygems'
require 'rest_client'
sources = "sources"
output = "scripts.min.js"
output_path = (File.expand_path(File.dirname(__FILE__))) + "/" + output
sources_path = (File.expand_path(File.dirname(__FILE__))) + "/" + sources
# TODO: only open file if no errors, maybe save a tmp file, then copy it over the real one?
@raine
raine / heroku-logs-with-bunyan.md
Last active August 3, 2018 19:14
Read heroku log output with bunyan

Read heroku logs output w/ bunyan

The stuff before the JSON in heroku logs output has to be cut off for bunyan to work.

$ heroku logs | sed -l 's/.*app\[web\..*\]\: //' | bunyan

Flag -l makes the output buffered by line.

@level09
level09 / rebuild_permissions
Created July 21, 2012 12:02
Drush: rebuild permissions table using command line in Drupal
drush php-eval 'node_access_rebuild();'
@i-scorpion
i-scorpion / README.txt
Created June 18, 2012 12:24
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
@jonraasch
jonraasch / highlight.js
Created September 2, 2010 22:14
Live on-page text highlighting
/*
highlight v3 !! Modified by Jon Raasch (http://jonraasch.com) to fix IE6 bug !!
Highlights arbitrary terms.
<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
MIT license.
@jeresig
jeresig / .vimrc
Created May 4, 2011 16:46
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on
import sys
import subprocess
import tempfile
import urllib
text = sys.stdin.read()
chart_url_template = ('http://chart.apis.google.com/chart?'
'cht=qr&chs=300x300&chl={data}&chld=H|0')
chart_url = chart_url_template.format(data=urllib.quote(text))
@dgraham
dgraham / fetch.js
Last active March 24, 2023 15:44
Simple window.fetch wrapper.
(function() {
function status(response) {
if (response.ok) {
return response
} else {
var error = new Error(response.statusText || response.status)
error.response = response
throw error
}
}