This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Good | |
import Database.Persist.Sql | |
toSqlKey 1 :: UserId | |
-- Bad | |
Prelude.read "UserKey {unUserKey = SqlBackendKey {unSqlBackendKey = 1}}" :: UserId |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import terminatorlib.plugin as plugin | |
import subprocess | |
# Every plugin you want Terminator to load *must* be listed in 'AVAILABLE' | |
AVAILABLE = ['FileURLHandler'] | |
class FileURLHandler(plugin.URLHandler): | |
capabilities = ['url_handler'] | |
handler_name = 'file_path' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var C_TYPE = 'Type', | |
C_TITLE = 'Title', | |
C_ID = 'ID', | |
C_URL = 'URL', | |
C_MIME_TYPE = 'file type', | |
C_ELEMENTS = 'elements in document'; | |
var HEADERS = [C_TYPE, C_TITLE, C_ID, C_URL, C_MIME_TYPE, C_ELEMENTS]; | |
function onOpen(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages. | |
# ghc-pkg-clean -f cabal/dev/packages*.conf also works. | |
function ghc-pkg-clean() { | |
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'` | |
do | |
echo unregistering $p; ghc-pkg $* unregister $p | |
done | |
} | |
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copyFbRecord(oldRef, newRef) { | |
oldRef.once('value', function(snap) { | |
newRef.set( snap.value(), function(error) { | |
if( error && typeof(console) !== 'undefined' && console.error ) { console.error(error); } | |
}); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from subprocess import Popen, PIPE | |
from json import loads | |
class Task(object): | |
def __init__(self, data): | |
self.data = data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git show HEAD --stat=200 | tail +7 | awk '{ print $3 " "$4 " " $1}' | sort -n -r | less |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MainCtrl = ($scope) -> | |
$scope.list = [4,2,1,11] | |
$scope.set = {a:1,b:1,c:1} | |
$scope.fn = (x) -> console.log(x);x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"require github://Wizek/jquery/src/intro.js" | |
"require github://Wizek/jquery/src/core.js" | |
"require github://Wizek/jquery/src/callbacks.js" | |
"require github://Wizek/jquery/src/deferred.js" | |
"require github://Wizek/jquery/src/support.js" | |
"require github://Wizek/jquery/src/data.js" | |
"require github://Wizek/jquery/src/queue.js" | |
"require github://Wizek/jquery/src/attributes.js" | |
"require github://Wizek/jquery/src/event.js" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Superpowered logging for AngularJS. | |
angular.module('logFactory', ['ng']) | |
.value('logFactory_whiteList', /.*/) | |
//.value('logFactory_whiteList', /!|.*Ctrl|run/) | |
.value('logFactory_piercingMethods', {warn:true, error:true}) | |
.factory('logFactory', ['$log', 'logFactory_whiteList' , 'logFactory_piercingMethods', function ($log, whiteList, piercing) { | |
piercing = piercing || {} |