This file contains hidden or 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
# ~/.ondirrc | |
enter ~/Documents/(<your|folder|names|here)/([^/]+) | |
[[ -s $HOME/<pathtoyour>/ondirrc.sh ]] && . $HOME/<pathtoyour>/ondirrc.sh | |
This file contains hidden or 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
fn(function(val) { | |
console.log(val); | |
}, function(val) { | |
console.log(val); | |
}); | |
// foo | |
// bar | |
This file contains hidden or 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
/* jshint node: true */ | |
var i = 0; | |
var a = function b() { | |
i++; | |
// 3x | |
if (4 === i) { | |
return; |
This file contains hidden or 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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
uglify: { | |
dist: { | |
files: [{ | |
expand: true, | |
cwd: './', | |
src: ['index.js'], | |
dest: 'dist' |
This file contains hidden or 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
/* jshint node: true */ | |
var i = 0; | |
var len = 5; | |
for(; i<len; i++) { | |
// a => 0, 1, 2, 3, 4 | |
setTimeout(a.bind(null, i)); |
This file contains hidden or 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
/* | |
* grunt | |
* https://github.com/cowboy/grunt | |
* | |
* Copyright (c) 2012 "Cowboy" Ben Alman | |
* Copyright (c) 2012 John K. Paul @johnkpaul | |
* Licensed under the MIT license. | |
* http://benalman.com/about/license/ | |
*/ |
This file contains hidden or 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
/* jshint node: true */ | |
var assert = require("chai").assert; | |
var origNumbers = [1, 2, 3, 4, 5]; | |
var numbers = [1, 2, 3, 4, 5]; | |
/* | |
* square each item in array |
This file contains hidden or 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
/* jshint node: true */ | |
var assert = require('assert'); | |
/* | |
* named function | |
*/ | |
function named() { |
This file contains hidden or 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
/* jshint node: true */ | |
var assert = require("assert"); | |
/* | |
* fn | |
* | |
* @return {Function} | |
*/ |
This file contains hidden or 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
# add this file capybara_wait_until.rb to your /test directory | |
module Capybara | |
class Session | |
## | |
# | |
# Retry executing the block until a truthy result is returned or the timeout time is exceeded | |
# | |
# @param [Integer] timeout The amount of seconds to retry executing the given block | |
# |