What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
import argparse | |
import re | |
from multiprocessing.pool import ThreadPool as Pool | |
import requests | |
import bs4 | |
root_url = 'http://pyvideo.org' | |
index_url = root_url + '/category/50/pycon-us-2014' | |
/*jshint asi:true, proto:true */ | |
/* bling.js */ | |
window.$ = document.querySelectorAll.bind(document) | |
Node.prototype.on = window.on = function(names, fn) { | |
var self = this | |
names.split(' ').forEach(function(name) { |
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];
These tools inject a breakpoint, console.log
or console.count
in any function you want to spy on via
stopBefore('Element.prototype.removeChild')
or ditto stopAfter
, logBefore
/ logAfter
/ logAround
/ logCount
.
Works in Chrome DevTools and Safari Inspector; Firefox dev tools reportedly less so.
Originally just 8 Sass mixins you must have in your toolbox, now there are more!
Usage:
/* | |
* Easing Functions - inspired from http://gizma.com/easing/ | |
* only considering the t value for the range [0, 1] => [0, 1] | |
*/ | |
EasingFunctions = { | |
// no easing, no acceleration | |
linear: function (t) { return t }, | |
// accelerating from zero velocity | |
easeInQuad: function (t) { return t*t }, | |
// decelerating to zero velocity |
/* ----------------------------------------------------------------------------- | |
### Mocha Guide to Testing ### | |
Objective is to explain `describe()`, `it()`, and `before()`/etc hooks. | |
1. `describe()` is merely for grouping, which you can nest as deep | |
as is required. | |
2. `it()` is a test case. |
// globals.js | |
// https://gist.github.com/pocotan001/6305714 | |
// Finding improper JavaScript globals | |
(function() { | |
var prop, cleanWindow, | |
globals = new function globals() {}, | |
body = document.body, | |
iframe = document.createElement('iframe'), | |
ignore = { |
/** | |
* Module dependencies. | |
*/ | |
var path = require('path') | |
// prompt | |
exports.PS1 = function(){ |
#export PATH=$PATH:/Library/PostgreSQL/8.4/bin/ | |
dropdb -U postgres mydb | |
createdb -E UTF8 -U postgres mydb | |
psql -U postgres -d mydb < mydb-snapshot.sql | |
# or pg_restore -U postgres --dbname mydb --verbose mydb-snapshot.backup | |
# or pg_restore -U postgres --dbname mydb --verbose --no-owner mydb-snapshot.backup |