Skip to content

Instantly share code, notes, and snippets.

@rohn
rohn / .block
Last active Mar 7, 2016 — forked from mbostock/.block
Area with Missing Data
View .block
license: gpl-3.0
@rohn
rohn / .block
Last active Feb 19, 2016 — forked from mbostock/.block
Stacked Bar Chart
View .block
license: gpl-3.0
@rohn
rohn / destructuring.js
Last active Nov 25, 2015
destructuring nested objects with value changes
View destructuring.js
const state = {a:1, b:2, c:3, d:{aa:11, bb:22}}
console.log(state) // { a: 1, b: 2, c: 3, d: { aa: 11, bb: 22 } }
const b = 55
const aa = 444
const total = {...state, b, d: {...state.d, aa}}
console.log(total) // { a: 1, b: 55, c: 3, d: { aa: 444, bb: 22 } }
@rohn
rohn / gulpfile.js
Last active Aug 29, 2015
my current fast create gulpfile.js & package.json for quick web page making
View gulpfile.js
var gulp = require('gulp');
var gutil = require('gulp-util');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var connect = require('gulp-connect');
var header = require('gulp-header');
var jpegoptim = require('imagemin-jpegoptim');
var jshint = require('gulp-jshint');
var livereload = require('gulp-livereload');
var optipng = require('imagemin-optipng');
View gruntfile.js
module.exports = function (grunt) {
"use strict";
// Config...
grunt.initConfig({
watch: {
options: {
livereload: true
},
html: {
@rohn
rohn / Gruntfile.js
Created Nov 10, 2014
more extensive Gruntfile
View Gruntfile.js
'use strict';
module.exports = function(grunt) {
//
// Load Tasks
//
require('load-grunt-tasks')(grunt, [
'grunt-*',
@rohn
rohn / Gruntfile.js
Created Nov 4, 2014
Grunt livereload
View Gruntfile.js
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-contrib-connect will serve the files of the project
// on specified port and hostname
View keybase.md

Keybase proof

I hereby claim:

  • I am rohn on github.
  • I am rohn (https://keybase.io/rohn) on keybase.
  • I have a public key whose fingerprint is 7DF4 2529 A2DA A4B8 8FD0 EF72 A791 5551 906D 1BEE

To claim this, I am signing this object:

@rohn
rohn / extendedModule.js
Last active Dec 17, 2015
an example of a module pattern, extending another object
View extendedModule.js
var _ = require('underscore');
// an object that we will extend later
var foo = {
baz: function() {
// some interesting behaviour
}
};
foo.baz.prototype.fubar = function() {
@rohn
rohn / _.md
Created May 1, 2013
Tributary inlet
You can’t perform that action at this time.