NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
" Git rebase helper for: | |
" git rebase --interactive | |
" | |
" L - view commit log | |
" p - pick | |
" e - edit | |
" s - squash | |
" r - reword | |
" D - delete | |
" |
#!/bin/sh | |
# | |
# a simple way to parse shell script arguments | |
# | |
# please edit and use to your hearts content | |
# | |
ENVIRONMENT="dev" |
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Try::Tiny; | |
plugin 'disqus', { 'api_secret' => 'getyourownsecretplease', pass_api_errors => 1 }; | |
# This, of course, is total and utter overkill for something like this, | |
# but I figured if I'm going to write demonstration code, might as well | |
# go the whole hog. | |
plugin 'mongodb', { 'database' => 'disqusbridge' }; |
(function addXhrProgressEvent($) { | |
var originalXhr = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
progress: function() { console.log("standard progress callback"); }, | |
xhr: function() { | |
var req = originalXhr(), that = this; | |
if (req) { | |
if (typeof req.addEventListener == "function") { | |
req.addEventListener("progress", function(evt) { | |
that.progress(evt); |
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: gunicorn-graphite | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Should-Start: $nginx | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: gunicorn + nginx ubuntu init script | |
# Description: gunicorn + nginx ubuntu init script |
As configured in my dotfiles.
start new:
tmux
start new with session name:
angular.module('test', []) | |
.directive('placeholder', function($timeout){ | |
if (!$.browser.msie || $.browser.version >= 10) { | |
return {}; | |
} | |
return { | |
link: function(scope, elm, attrs){ | |
if (attrs.type === 'password') { | |
return; | |
} |
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc | |
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/ | |
// author: Pawel Kozlowski | |
var myApp = angular.module('myApp', []); | |
//service style, probably the simplest one | |
myApp.service('helloWorldFromService', function() { | |
this.sayHello = function() { | |
return "Hello, World!" |