Skip to content

Instantly share code, notes, and snippets.

View peebeebee's full-sized avatar

Peter Briers peebeebee

View GitHub Profile
@peebeebee
peebeebee / 0_reuse_code.js
Created July 1, 2014 07:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// By observing changes to an object with Object.observe,
// and turning on Async Call Stacks in Chrome Dev Tools,
// you can find the source of those changes.
var myObject = {
foo: 'bar'
};
Object.observe(myObject, function(changes) {
// This asynchronous callback runs when myObject is changed
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
log = function(arg) {
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@peebeebee
peebeebee / gist:a27468df8aaca92fefc3
Created June 26, 2015 09:00
Handy Shell Functions
# .bash_profile
# Type `up 7` to do cd ../../../../../../..
function up() {
i=$1
while [ $i -gt 0 ]
do
cd ..
i=$(($i - 1))
done
}
@peebeebee
peebeebee / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@peebeebee
peebeebee / rAF.js
Last active August 29, 2015 14:27 — forked from paulirish/rAF.js
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@peebeebee
peebeebee / gist:080fcd513af338595a09
Created October 6, 2015 14:11 — forked from dmethvin/gist:1676346
Breakpoint on access to a property
function debugAccess(obj, prop, debugGet){
var origValue = obj[prop];
Object.defineProperty(obj, prop, {
get: function () {
if ( debugGet )
debugger;
return origValue;
},
@peebeebee
peebeebee / convert.sh
Last active October 14, 2015 19:28
Caliber RDD 571BT
INPUT="$1"
OUTPUT=${INPUT%.*}.avi
ffmpeg -i "$INPUT" -b:v 1M -vf scale=720:480 -c:v mpeg4 -vtag xvid "$OUTPUT"
@peebeebee
peebeebee / Canvas Experiments 006.markdown
Created April 19, 2016 20:18
Canvas Experiments 006