This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// just working on FF | |
var log = (function() { | |
if(window.console && typeof window.console.log === 'function') | |
return console.log | |
return function() {} | |
})(); | |
// idem | |
if (typeof console == "undefined" || typeof console.log == "undefined") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var test = function( | |
a, // a object holding test functions | |
b, // a logging function, taking multiple arguments | |
c, // placeholder | |
d, // placeholder | |
e, // placeholder | |
f // placeholder | |
){ | |
c = d = e = 0; // initialize asserts, failures and exception counts to 0 | |
for ( // iterate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="q.js"></script> | |
<script> | |
function add(millis, answer, msg) { | |
const defer = Q.defer(); | |
setTimeout(function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
tell application "Safari" to activate | |
tell application "System Events" | |
tell process "Safari" | |
tell menu bar 1 | |
tell menu bar item "Develop" | |
tell menu "Develop" | |
tell menu "iPhone Simulator" of menu item "iPhone Simulator" | |
delay 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// example 1 | |
// create a cube | |
var cube = create([{ | |
display:"none", | |
top:"50px", | |
left:"200px", | |
backgroundColor:"rgb(225, 70, 128)" | |
}])[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// tiny Zanimo.js example | |
var Zanimo = require('zanimo'), | |
Qimage = require('qimage'); | |
function setup() { | |
return Qimage("http://requirebin.com/logo-black.png") | |
.then(function (img) { | |
img.style.position = 'absolute'; | |
img.style.top = '100px'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (config) { | |
for(var ƒ in config) { | |
if (typeof config[ƒ] === "function") { | |
this[ƒ] = lui.bind(config[ƒ], self); | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Zanimo = require('zanimo'); | |
var prefix = require('vendor-prefix'); | |
var elt = document.createElement('div'); | |
elt.style.height = '100px'; | |
elt.style.width = '800px'; | |
elt.style.position = 'absolute'; | |
elt.style.top = '50px'; | |
elt.style.left = '50px'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var norm = require('zanimo/src/normalize-transform-value'), | |
Color = require('color'); | |
var el = document.createElement('div'); | |
el.style.height='300px'; | |
el.style.width='500px'; | |
document.body.appendChild(el); | |
// testing normalize-transform-value |
OlderNewer