Skip to content

Instantly share code, notes, and snippets.

View tzellman's full-sized avatar

Tom Zellman tzellman

  • Knowbl
  • Michigan
View GitHub Profile
package gist;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.Iterator;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.python.core.PyCode;
import org.python.core.PyFunction;
@tzellman
tzellman / .gitconfig
Created March 1, 2012 09:45
Aliases in my .gitconfig
[alias]
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\""
unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
rb = !"git wip;git rebase -i origin/master;git unwip"
pr = !"git fetch;git wip;git rebase --stat origin;git unwip;git heads"
head = !"git log -n1"
lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'"
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
fix = commit --amend -C HEAD
(function(a){var b={},c=function(d){var e=b[d];if(!e){e=b[d]={};var f=e.exports={};a[d].call(f,c,e,f,window)}return e.exports};window.Monad=c("0")})({0:function(a,b,c,d){function e(a){if(a instanceof e)return a;this.value=function(){return a}}e.prototype.bind=function(a){var b=this.value();return a===e||b===null||b===undefined?this:typeof a=="function"?new e(a(b)):this},b.exports=e}})
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.winnings {
font: 100px/500px Menlo;
text-align: center;
width: 100%;
}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg circle {
cursor: pointer;
fill-opacity: 0.2;
}
<!DOCTYPE html>
<meta charset="utf-8">
<style>
svg circle {
cursor: pointer;
fill-opacity: 0.2;
}
svg text {
<!DOCTYPE html>
<meta charset="utf-8">
<style>
circle.node {
cursor: pointer;
stroke: #000;
stroke-width: .5px;
}
@tzellman
tzellman / components.my-component.js
Last active December 6, 2016 17:15
isVisible bug
import Ember from 'ember';
export default Ember.Component.extend({
vizProp: Ember.computed("isVisible", function(){
let viz = this.get("isVisible");
return viz === undefined ? "undefined" : (viz === null ? "null" : viz);
})
});
@tzellman
tzellman / controllers.application.js
Last active April 3, 2017 21:39
Ember Concurrnency LastSuccessful gotcha
import Ember from 'ember';
import {task, timeout} from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
holdAndWait: task(function*(millis, value){
yield timeout(millis);
return value;
}),
@tzellman
tzellman / controllers.application.js
Last active April 4, 2017 09:22
EC orchestration
import Ember from 'ember';
import {task, timeout} from 'ember-concurrency';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
inputValue: 0,
numProcessed: 0,
onValueChange: Ember.observer("inputValue", function(){
this.get("processSoon").perform(this.get("inputValue"));