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
{ | |
// Details: https://github.com/victorporof/Sublime-JSHint#using-your-own-jshintrc-options | |
// Example: https://github.com/jshint/jshint/blob/master/examples/.jshintrc | |
// Documentation: http://www.jshint.com/docs/ | |
"browser": true, | |
"esnext": true, | |
"globals": {}, | |
"globalstrict": true, | |
"quotmark": true, | |
"smarttabs": true, |
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
<p>Ok, every cloud has a silver lining. Despite having a moment on how the <a href="http://docs.sublimetext.info/en/latest/reference/build_systems.html">Sublime Text Build tool configuration</a> works, I found an even easier way to run Grunt tasks from within Sublime. Here's how:</p> | |
<p>1. Press Command (or Control on Linux)-shift-P to bring up the command palette and start typing 'install' - you should see 'Package Control: Install Package'.</p> | |
<p>2. Hit enter, and then type 'Grunt'- you should see in small text a link to the Github repo for <a href="https://github.com/tvooo/sublime-grunt">tvooo/sublime-grunt</a>, press enter to install</p> | |
<p>3. Now if you press Command-shift-P, and type grunt, enter, you should see your grunt tasks</p> | |
<p>4. Press enter to run the grunt task</p> | |
<p>If this doesn't work, make sure you are starting Sublime Text via the 'subl .' command from your project directory. Don't start Sublime via the Dock or Unity menu. </p> | |
<p>Note: JSHint <em>is supposed to fail</em> if |
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 http = require('http'); | |
console.log("Creating Server"); | |
var server = http.createServer(function(request, response) { | |
response.writeHead(201); | |
response.write("<h1>hello from IVAN's computer</h1>"); | |
response.end(); | |
}); |
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
// find the element in the array | |
var find = function(list, assertion) { | |
'use strict'; | |
var recur = function(seq) { | |
var head = seq[0], tail = seq.slice(1); | |
if ( seq.length === 0 ) return undefined; | |
else if ( assertion(head) ) return head; | |
else return recur(tail); | |
}; |
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 promise() { | |
var listeners = [], | |
resolved = false, | |
data; | |
return { | |
isResolved: function() { | |
return resolved; | |
}, | |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
alias gitlog='git log --graph --pretty=format:'\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --date=relative' |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
clean: ['dist'], | |
ejs: { | |
all: { | |
options: { | |
// site-wide vars here | |
}, |
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
clean: ['dist'], | |
ejs: { | |
all: { | |
options: { | |
// site-wide vars here | |
}, |
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
{ | |
"name": "book_code", | |
"version": "0.0.0", | |
"description": "example code from JavaScript Web Applications by Alex MacCaw", | |
"main": "app.js", | |
"directories": { | |
"doc": "docs" | |
}, | |
"dependencies": { | |
"browserify": "~3.31.2", |
OlderNewer