Run 5 times, with one second delay between calls
t1 = new Timer(500, function(){
console.log(this.count);
if (this.count >= 5) {
this.stop();
}
});
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
(function addXhrProgressEvent($) { | |
var originalXhr = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
progress: function() { console.log("standard progress callback"); }, | |
xhr: function() { | |
var req = originalXhr(), that = this; | |
if (req) { | |
if (typeof req.addEventListener == "function") { | |
req.addEventListener("progress", function(evt) { | |
that.progress(evt); |
/* | |
The original files are 960x319. | |
Image sizes to save: | |
* 800x266 - Retina for 480x320 resolution (400 logical pixel wide panel areas) | |
* 740x246 - Desktop and iPad | |
* 616x205 - Retina for 320x480 resolution (308 logical pixel wide panel areas) | |
* 400x133 - 480x320 resolution | |
* 308x102 - 320x480 resolution |
[user] | |
name = Jeremy Helms | |
email = digitaljhelms@gmail.com | |
[alias] | |
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort # list all aliases | |
cb = !git branch | grep ^* | cut -d' ' -f2 | |
branch-name = !git cb # alias to "cb" alias | |
st = status | |
ci = commit | |
cie = commit --allow-empty-message -m '' |
/* | |
limitLoop.js - limit the frame-rate when using requestAnimation frame | |
Released under an MIT license. | |
When to use it? | |
---------------- | |
A consistent frame-rate can be better than a janky experience only | |
occasionally hitting 60fps. Use this trick to target a specific frame- | |
rate (e.g 30fps, 48fps) until browsers better tackle this problem |
You can test with the iOS Simulator that comes with Xcode. Navigate to the Xcode app in the Finder, right click and select "Show Package Contents":
Then navigate to Contents > Applications, and open the shortcut to "iPhone Simulator" (it may be called "iOS Simulator" depending on which version of Xcode you're running):
/* | |
Common vector operations | |
Author: Tudor Nita | cgrats.com | |
Version: 0.51 | |
*/ | |
function Vec2(x_,y_) | |
{ | |
this.x = x_; | |
this.y = y_; |
W3C Introduction to Web Components - explainer/overview of the technologies
# Assuming an Ubuntu Docker image | |
$ docker run -it <image> /bin/bash |