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: poor stylistic form, but no leakage | |
function foo() { | |
bar = 3; | |
if (true) { | |
var bar = 5; | |
} | |
} | |
// let: will leak an auto-global | |
function foo() { |
Creating async tests with jasmine is quite intuitive.
If you've read the documentation, then you are aware of the [waitsFor
][2] and [runs
][2] helpers in Jasmine.
I had more than one async action in my test, so it required an inspection on my side to verify that Jasmine would run the test in the same way I had expected.
If you specify a series of waitsFor
or waits
and runs
callbacks, then Jasmine will start the countdown for each waitsFor
at the appropriate time (in this gist - after the previous runs
callback was completed).
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
body { | |
white-space: pre; | |
font-family: monaco, Consolas, Menlo, monospace; | |
color: white; | |
background: #282a36; | |
font-size: 12px; | |
line-height: 1.5m; | |
} | |
.property { |
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
;(function($){ | |
var touch = {}, | |
touchTimeout, tapTimeout, swipeTimeout, | |
longTapDelay = 750, longTapTimeout | |
function parentIfText(node) { | |
return 'tagName' in node ? node : node.parentNode | |
} | |
function swipeDirection(x1, x2, y1, y2) { |
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
(function($){ | |
var touch = {}, touchTimeout; | |
function parentIfText(node){ | |
return 'tagName' in node ? node : node.parentNode; | |
} | |
function swipeDirection(x1, x2, y1, y2){ | |
var xDelta = Math.abs(x1 - x2), yDelta = Math.abs(y1 - y2); | |
if (xDelta >= yDelta) { |
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/sh | |
# @author: Claus Witt | |
# http://clauswitt.com/319.html | |
# Adding or Removing Items to hosts file | |
# Use -h flag for help | |
DEFAULT_IP=127.0.0.1 | |
IP=${3:-$DEFAULT_IP} |
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
// http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically | |
module.exports = function(grunt) { | |
/** | |
* Saves having to declare each dependency | |
*/ | |
require( "matchdep" ).filterDev( "grunt-*" ).forEach( grunt.loadNpmTasks ); | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), |
Here's what I did to get things working.
Yep, over at: https://developer.apple.com
OlderNewer