Skip to content

Instantly share code, notes, and snippets.

View ivanoats's full-sized avatar
💭
🤙 Stoked 🏄‍♂️

Ivan Storck ivanoats

💭
🤙 Stoked 🏄‍♂️
View GitHub Profile
{
// 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,
<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. &nbsp;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.&nbsp;</p>
<p>Note: JSHint <em>is supposed to fail</em> if
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();
});
@ivanoats
ivanoats / find.js
Created February 20, 2014 21:47
Recursion example
// 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);
};
@ivanoats
ivanoats / promise.js
Created February 20, 2014 23:45 — forked from dhable/promise.js
function promise() {
var listeners = [],
resolved = false,
data;
return {
isResolved: function() {
return resolved;
},
@ivanoats
ivanoats / 0_reuse_code.js
Created February 23, 2014 19:20
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ivanoats
ivanoats / git log alias
Created February 24, 2014 21:13
git log
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'
module.exports = function(grunt) {
grunt.initConfig({
clean: ['dist'],
ejs: {
all: {
options: {
// site-wide vars here
},
module.exports = function(grunt) {
grunt.initConfig({
clean: ['dist'],
ejs: {
all: {
options: {
// site-wide vars here
},
{
"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",