Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View j-kan's full-sized avatar

Jim Kan j-kan

View GitHub Profile
@michaelwoods
michaelwoods / prepare-commit-msg.sh
Last active July 16, 2018 15:30 — forked from bartoszmajsak/prepare-commit-msg.sh
Regex matching of JIRA story keys to prepend git commits.
#!/bin/bash
STORY_KEY=$(git symbolic-ref --short HEAD | grep -Eo '^[a-zA-Z0-9]{3,}[-_][0-9]{1,5}' | awk '{sub(/_/, "-"); print toupper($0)}')
if [ -n "$STORY_KEY" ]; then
sed -i.bak -e "1s/^/[$STORY_KEY] /" $1
fi
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// 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!"
@ghoseb
ghoseb / ns-cheatsheet.clj
Last active April 11, 2024 05:28 — forked from alandipert/ns-cheatsheet.clj
Clojure ns syntax cheat-sheet
;;
;; NS CHEATSHEET
;;
;; * :require makes functions available with a namespace prefix
;; and optionally can refer functions to the current ns.
;;
;; * :import refers Java classes to the current namespace.
;;
;; * :refer-clojure affects availability of built-in (clojure.core)
;; functions.