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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<style> | |
body { | |
position: relative; | |
height: 100px; | |
border-bottom: solid 2px hsl(340, 5%, 75%); |
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
# Checkout files that were deleted | |
git status --porcelain | grep "^ D" | cut -c4- | xargs git checkout $1 |
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 gulp = require('gulp'); | |
// Let's make things more readable by | |
// encapsulating each part's setup | |
// in its own method | |
function startExpress() { | |
var express = require('express'); | |
var app = express(); | |
app.use(express.static(__dirname)); |
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 () { | |
var months = { | |
'Jan': '01', | |
'Feb': '02', | |
'Mar': '03', | |
'Apr': '04', | |
'May': '05', | |
'Jun': '06', | |
'Jul': '07', | |
'Aug': '08', |
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 Parent = Backbone.Model.extend({ | |
defaults: function () { | |
return { | |
prop: 'value', | |
anotherProp: 'anotherValue' | |
} | |
} | |
}); |
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
#!/usr/bin/env node | |
var exec = require('child_process').exec; | |
// Runs the build task, in our case `grunt jshint` | |
exec('grunt jshint', function (error, stdout, stderr) { | |
// Build task output might be useful to the developer so let's print it | |
// We could also log it in a file | |
console.log(stdout); |
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
#!/usr/bin/env node | |
var fs = require('fs'), | |
util = require('util'); | |
// Rattern to format the message with the issue ID | |
var MESSAGE_FORMAT = '[%s] %s'; | |
// Git commit messages are stored in a file, passed as argument to the script | |
// First and second arguments will be 'node' and the name of the script | |
var commitFile = process.argv[2]; |
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
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet! | |
module.exports = function(grunt) { | |
// Load Grunt tasks declared in the package.json file | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// Configure Grunt | |
grunt.initConfig({ | |
// grunt-express will serve the files from the folders listed in `bases` |
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
// Gruntfile with the configuration of grunt-express and grunt-open. No livereload yet! | |
module.exports = function(grunt) { | |
// Load Grunt tasks declared in the package.json file | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// Configure Grunt | |
grunt.initConfig({ | |
// grunt-express will serve the files from the folders listed in `bases` |
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": "grunt-livereload-renewed", | |
"version": "1.0.0", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"matchdep": "~0.1.2", | |
"grunt-express": "~1.0.0-beta2", | |
"grunt-contrib-watch": "~0.5.1", | |
"grunt-open": "~0.2.1" | |
} |