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("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
| /* | |
| * 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 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
| 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 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
| 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
| # ~/.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
| package wordcount | |
| import "strings" | |
| func WordCount(s string) map[string]int { | |
| var ( | |
| arrOfWords []string | |
| wordMap map[string]int | |
| ) |
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
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { |