Skip to content

Instantly share code, notes, and snippets.

@natural-affinity
natural-affinity / snippet.node-rest-jenkins.md
Last active August 29, 2015 14:17
Trigger a parameterized build via the Jenkins REST API
var request = require('request');
var express = require('express');
var validator = require('validator');

module.exports = (function () {
  'use strict';
  var api = express.Router();

 api.use(function(req, res, next) {
@natural-affinity
natural-affinity / snippet.grunt-conditional-task.md
Created February 6, 2015 18:22
Run sub-task conditionally, based on JSON meta-data
module.exports = function (grunt) {
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    client: grunt.file.readJSON('client.json')
  });

  grunt.registerTask('conditional-task', []);
@natural-affinity
natural-affinity / snippet.bower-json-git-master.md
Last active August 29, 2015 14:11
Use master branch of forked git repository in bower.json
{
  "name": "bower.repo",
  "dependencies": {
    "ink": "git+https://github.com/AllClearID/ink.git#master"
  },
  "devDependencies": {}
}
@natural-affinity
natural-affinity / protip.defonic.md
Last active August 29, 2015 14:08
Zen Productivity: UX Hack

JS Console + Defonic + Chromecast

  • Awesome Ambient Noise/Videoscape Product for relaxation (e.g. http://defonic.com)
  • Can cast to TV for a 50 inch+ version via chromcast or similar device
  • Quick Page hack via JS console = Awesome

Steps

@natural-affinity
natural-affinity / snippet.grunt-curl-json.md
Last active August 29, 2015 14:07
Fetch JSON from express server API via grunt-curl with command-line args
module.exports = function (grunt) {
  require('load-grunt-tasks')(grunt);

  grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    slug: grunt.option('slug'),
    curl: {
      json: {
 src: 'http://0.0.0.0:<%= express.options.port %>/api/clients/<%= slug %>',
@natural-affinity
natural-affinity / protip.npm-sudo.md
Last active February 14, 2016 10:13
NPM EACCESS Problems (sudo)

Description

Assuming the OSX Node Installer was used with your current user as the medium,
the root of the problem seems to stem from incorrect ownership of the node_modules
directory (not so much the /usr/local directory).

$ ls -l /usr/local/lib