Skip to content

Instantly share code, notes, and snippets.

View frapontillo's full-sized avatar

Francesco Pontillo frapontillo

View GitHub Profile
@bholmberg
bholmberg / cornify.directive.js
Created March 25, 2013 16:34
AngularJS directive to cornify a web page when the "konami code" entered on the keyboard. I wrapped js I found on a blog into a DDO.
ngApp.directive("cornify", function () {
return {
link: function (scope, element, attrs) {
var konami_keys = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
var konami_index = 0;
$(document).keydown(function(e){
if (e.keyCode === konami_keys[konami_index++]) {
if (konami_index === konami_keys.length) {
$(document).unbind('keydown', arguments.callee);
$.getScript('http://www.cornify.com/js/cornify.js',function(){
@alexjlockwood
alexjlockwood / AccountUtils.java
Last active April 13, 2020 12:37
Account-related utility methods.
import android.accounts.Account;
import android.accounts.AccountManager;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Build;
import android.preference.PreferenceManager;
import com.google.android.gms.auth.GoogleAuthUtil;
@l15n
l15n / git-branches-by-commit-date.sh
Created July 13, 2012 08:47 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit's author and author date for each branch. Sort by most recent commit's author date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ai %ar by %an" $branch | head -n 1` \\t$branch; done | sort -r