I hereby claim:
- I am davej on github.
- I am davej (https://keybase.io/davej) on keybase.
- I have a public key ASCGM6pZ2DMI-QNgpHyOlpPARpMxaK5PQI2eJIkwfMxiwwo
To claim this, I am signing this object:
// Illustrative case | |
// YEAH -- ILLUSTRATIVE OF THE FACT THAT YOU CAN ISSUE PARALLEL QUERIES TO THE DATABASE INSTEAD OF SERIAL ONES LIKE A DUMB THREADED IMPLEMENTATION THAT IS INFERIOR FOR DOING WEB SERVERS | |
function (recentBlogPostIds, callback) { // obviously you need this, but use callback instead of return | |
var results = [], // Use array not object | |
, len = recentBlogPostIds.length; // Cache length since we'll be using it more than once | |
for (var i = 0; i < len; i++) { | |
var blogPostId = recentBlogPostIds[i]; |
""" | |
A simple script to copy a Basecamp classic todo list | |
over to Blimp as a goal with tasks | |
@author: Dave Jeffery | |
@requirements: | |
pip install git+git://github.com/nowherefarm/basecamp.git | |
pip install blimp | |
""" |
define [ | |
'base-ctrl' | |
], (BaseCtrl) -> | |
class AppController extends BaseCtrl | |
@register() | |
@inject('$scope') | |
init: -> | |
@$scope.foo = "bar" |
function createSite(name, assignedOptions = {}) { | |
const defaultOptions = { | |
html: 'jade', | |
styles: 'scss', | |
scripts: 'babel', | |
whitespace: '2 spaces', | |
}; | |
const options = Object.assign({}, defaultOptions, assignedOptions); | |
/* |
// Your scroll callback will only be called once per frame and only | |
// when the y-position changes. Good for doing DOM work without causing | |
// unnecessary reflows of the document. | |
function onScrollYChange(callback) { | |
let latestKnownScrollY = 0, ticking = false; | |
const scrollChanged = () => { | |
ticking = false; | |
const currentScrollY = latestKnownScrollY; | |
callback(currentScrollY) |
const isLocalhostName = window.location.hostname === 'localhost'; | |
const isLocalhostIPv6 = window.location.hostname === '[::1]'; | |
const isLocalhostIPv4 = window.location.hostname.match( | |
// 127.0.0.1/8 | |
/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ | |
); | |
const isLocalhost = isLocalhostName || isLocalhostIPv6 || isLocalhostIPv4; |
// only polyfill .finished in browsers that already support animate() | |
if (document.body.animate) { | |
// Chrome does not seem to expose the Animation constructor globally | |
if (typeof Animation === 'undefined') { | |
window.Animation = document.body.animate({}).constructor; | |
} | |
if (!('finished' in Animation.prototype)) { | |
Object.defineProperty(Animation.prototype, 'finished', { |
I hereby claim:
To claim this, I am signing this object:
# From https://discussions.apple.com/thread/8115237 | |
from time import sleep | |
while True: | |
sleep(0.00002) |