Skip to content

Instantly share code, notes, and snippets.

View Philzen's full-sized avatar
🌴
On vacation

Philzen

🌴
On vacation
  • Northern Germoney / Denmark / Planet Earth
View GitHub Profile
@Philzen
Philzen / requestAnimationFrame Polyfill (by calormen)
Created February 18, 2013 03:59
This is a sandbox to test the requestAnimationFrame Polyfill as offered by http://www.calormen.com/polyfill/. Mainly targeting Webkit 533.1 in order to gain some form of rendering framerate control on android 2 devices.
// requestAnimationFrame
// http://www.w3.org/TR/animation-timing/
(function() {
var TARGET_FPS = 60,
requests = {},
raf_handle = 1,
timeout_handle = -1;
function isVisible(element) {
return element.offsetWidth > 0 && element.offsetHeight > 0;
@Philzen
Philzen / RequestAnimationFrame Shim (List-Based)
Last active December 13, 2015 20:59 — forked from jonasfj/rAF.js
This is a sandbox to understand the list-based approach as put forward by @jonasfj. Mainly targeting Webkit 533.1 in order to gain some form of rendering framerate control on android 2 devices.
// 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
// list-based fallback implementation by Jonas Finnemann Jensen
(function() {
var vendors = ['ms', 'moz', 'webkit', 'o'];
@Philzen
Philzen / requestAnimationFrame Polyfill (the "original")
Last active December 13, 2015 20:28 — forked from paulirish/rAF.js
This is a sandbox to test the original requestAnimationFrame Polyfill as proposed by @paulirish. Mainly targeting Webkit 533.1 in order to gain some form of rendering framerate control on android 2 devices.
// 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
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for (var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
@Philzen
Philzen / node-uptime.sh
Created July 28, 2014 23:38
Daemonize uptime with forever on FreeBSD
#!/bin/sh
# PROVIDE: node_uptime
# REQUIRE: NETWORKING SERVERS DAEMON
# BEFORE: LOGIN
# KEYWORD: shutdown
. /etc/rc.subr
name="node_uptime"

Grunt and Cordova 3

The advantages of using Grunt with Cordova:

  1. It simplifies working with the cordova cli.
  2. It provides a mechanism to copy platform customization to the platforms directory without having to commit the generated plugins and platforms directories to version control.
  3. It provides a way to watch resources and automatically run cordova commands.