Skip to content

Instantly share code, notes, and snippets.

@adam-lynch
adam-lynch / index.js
Created June 11, 2015 21:59
Testing restarting NW.js app
var gui = require("nw.gui"),
child_process = require("child_process"),
win = gui.Window.get(),
child;
if (process.platform == "darwin") {
child = child_process.spawn("open", ["-n", "-a", process.execPath.match(/^([^\0]+?\.app)\//)[1]], {detached:true});
} else {
child = child_process.spawn(process.execPath, [], {detached: true});
}
browserSync = require 'browsersync'
# if you're using gulp, replace this with `require('gulp-util').colors`
chalk = require 'chalk'
# method - {String} (uppercase)
colourMethod = (method) ->
map =
'GET': 'green'
'POST': 'yellow'
'PUT': 'blue'
@adam-lynch
adam-lynch / windowsKillAllExeByName
Created October 16, 2015 10:15
Windows: Kill all .exe by name
taskkill /F /IM <processname.exe> /T
@adam-lynch
adam-lynch / convertBooleanToStringNumber.coffee
Created March 11, 2016 19:36
How to convert a Boolean to a string number in ES5, ES6, and CoffeeScript
convertBooleanToStringNumber = (boolean) -> +boolean + ''
@adam-lynch
adam-lynch / gist:c09a66551c4cdc713fdacfee40bdb9d1
Last active September 19, 2017 11:11
deals/1?include=events&page[events][size]=10&sort[events]=-createdAt&filter[events][type]=notes,files
{
id: 1,
type: deals,
attributes: {
...
},
relationships: {
events: {
data: [{
type: notes