Skip to content

Instantly share code, notes, and snippets.

@getify
getify / 1.js
Created November 13, 2012 00:19
illustrating some potential issues with adding `let` to code which already has `var` used in it...
// var: poor stylistic form, but no leakage
function foo() {
bar = 3;
if (true) {
var bar = 5;
}
}
// let: will leak an auto-global
function foo() {
@oraricha
oraricha / Theme editor.md
Last active December 18, 2015 08:59
List of my sublime text 2 installed packages
@amitzur
amitzur / README.md
Last active December 20, 2015 10:08
Multiple waitsFor in a jasmine test

Asynchronous Testing with [Jasmine]

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).

@borisd
borisd / Notes.md
Last active February 8, 2016 08:56
Redux 101 Workshop Notes - By 500Tech.com
@shirish87
shirish87 / JSONView Dark Theme.css
Created June 20, 2017 17:52 — forked from timnew/JSONView Dark Theme.css
This is a dark theme for JSONView chrome extension
body {
white-space: pre;
font-family: monaco, Consolas, Menlo, monospace;
color: white;
background: #282a36;
font-size: 12px;
line-height: 1.5m;
}
.property {
@twalling
twalling / jquery.touch.js
Created October 19, 2012 19:11
Zepto touch for jQuery
;(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) {
@sj26
sj26 / jquery.touch.js
Created June 16, 2011 02:43
Zepto touch for jQuery
(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) {
@bzerangue
bzerangue / update-hosts.sh
Last active March 3, 2020 13:54
A small shell script that will add and remove lines from the hosts file. Originally created by Claus Witt, http://clauswitt.com/319.html.
#! /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}
@tjFogarty
tjFogarty / Gruntfile.js
Last active June 18, 2020 15:35
Gruntfile that I use for projects
// 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'),
@chrisb
chrisb / gist:4d6a09c6cc1ca2e1b14e
Last active November 25, 2022 04:15
Homebrew, Ruby, and Rails on OS X 10.10

OS X 10.10 Guide

Here's what I did to get things working.

1. Install Xcode 6

Yep, over at: https://developer.apple.com

2. Install the Command Line Tools (CLT)