-
###Feature Testing Checkfor the existence of a method and checks that i returns the correct output
-
###Feature Detection Check for the existence of a method
-
###Weak Inference Check for the existence of an unrelated method
-
###User Agent Sniffing
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
Show hidden characters
{ | |
/*** Globals ***/ | |
// To ignore any custom global variables, enable the `predef` option and list | |
// your variables within it. | |
"predef": [ | |
"exports", | |
"YUITest", | |
"YUI", | |
"YUI_config", | |
"YAHOO", |
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
/* | |
* _fbq used for facebook custom audience | |
* Array.push overriden | |
*/ | |
function (t) { | |
if (Object.prototype.toString.call(t) !== '[object Array]') return false; | |
var u = t.shift(); | |
if (!u) return false; | |
var v = f[u]; | |
if (typeof v !== 'function') return false; |
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
'use strict'; | |
var fs = require('fs'); | |
var path = require('path'); | |
var chalk = require('chalk'); | |
var dargs = require('dargs'); | |
var slash = require('slash'); | |
var gutil = require('gulp-util'); | |
var spawn = require('win-spawn'); | |
var eachAsync = require('each-async'); | |
var intermediate = require('gulp-intermediate'); |
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
'use strict'; | |
var fs = require('fs'); | |
var path = require('path'); | |
var chalk = require('chalk'); | |
var dargs = require('dargs'); | |
var slash = require('slash'); | |
var gutil = require('gulp-util'); | |
var spawn = require('win-spawn'); | |
var eachAsync = require('each-async'); | |
var intermediate = require('gulp-intermediate'); |
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
/** | |
* test1(); | |
* Output: 22 | |
*/ | |
function test1(){ | |
var a = 11; | |
eval('(a = 22)'); | |
alert(a); | |
} |
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
#!/bin/bash -eu | |
# | |
# Color log4j-style logs for easier visual parsing. | |
# | |
# Usage: | |
# tail foo.log | log-color | |
# run-service | log-color | |
black="` tput setaf 0; tput bold`" | |
red="` tput setaf 1; tput bold`" |
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 |
function atomuitail(){
tail -f $1 | awk '
/MEMC/ {print "\033[32m" $0 "\033[39m"}
/DEBUG/ {print "\033[32m" $0 "\033[39m"}
/ERROR/ {print "\033[31m" $0 "\033[39m"}
/error_message/ {print "\033[31m" $0 "\033[39m"}
'
}