Skip to content

Instantly share code, notes, and snippets.

@vjpr
vjpr / README.md
Created Aug 9, 2015
npm README template
View README.md

live-xxx

${DESCRIPTION}

[![NPM Version][npm-image]][npm-url] [![Linux Build][travis-image]][travis-url] [![Test Coverage][coveralls-image]][coveralls-url]

Install

View with-require-ensure.js
/******/ (function(modules) { // webpackBootstrap
/******/ // install a JSONP callback for chunk loading
/******/ function webpackJsonpCallback(data) {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var executeModules = data[2];
/******/
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0, resolves = [];
View README.md

Atom Settings

Atom took ages to setup correctly to get the same functionality I was use to when doing Node.js, ES6/7 development in IntelliJ.

Therefore I want to share all my settings with the world to hopefully save some of you some time.

I use the synced-settings Atom module which syncs my Atom settings to a Gist.

Usage

@vjpr
vjpr / README.md
Last active Feb 4, 2016 — forked from skevy/gist:8a4ffc3cfdaf5fd68739
Reduce boilerplate in Redux
View README.md

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with promises, and therefore ES7 async.
@vjpr
vjpr / README.md
Last active Jan 4, 2016
RPC for Chrome Packaged App to allow communication between sandbox and privileged environment
View README.md

ChromeRPC

I will eventually turn this into a bower module when I have time with tests and the whole shebang.

Usage

background.html

<html>
@vjpr
vjpr / README.md
Last active Jan 4, 2016
IonIcons LESS support
View README.md

To specify a custom path for use in an asset pipeline (Sprockets or Mincer), modify _ionicons-variables.less:

@ionicons-font-path: asset-dir("ionicons/fonts/ionicons.ttf");
@vjpr
vjpr / index.coffee
Created Jun 22, 2013
Cache compiled js of required IcedCoffeeScript files
View index.coffee
temp = require 'temp'
fs = require 'fs'
path = require 'path'
_ = require 'underscore'
cachePath = {}
cache = {}
requireExt = (_cachePath) ->
@vjpr
vjpr / gist:5378401
Created Apr 13, 2013
An example of a Markdown file using &ensp; (\u2002) characters to indent paragraphs at different levels.
View gist:5378401
6  Rights and responsibilities of employees, employers, organisations etc. (Chapter 3)

            (1)  Chapter 3 sets out rights and responsibilities of national system employees, national system employers, organisations and others (such as independent contractors and industrial associations).

            (2)  Part 3-1 provides general workplace protections. It:

                     (a)  protects workplace rights; and

                     (b)  protects freedom of association and involvement in lawful industrial activities; and

@vjpr
vjpr / asyncTemplates.coffee
Created Nov 4, 2012
Asynchronous template compilation.
View asyncTemplates.coffee
logger = require('onelog').get('AsyncTemplates')
_ = require 'underscore'
sinon = require 'sinon'
async = require 'async'
hamlc = require 'haml-coffee'
# You MUST specify the ALL names of the methods which return asynchronously.
# This is required because sync helpers can be used in conditionals.
# This is useful for retrofitting existing code, or keeping code clean
# and portable.
@vjpr
vjpr / backbone-0.9.1.js
Created Feb 26, 2012 — forked from thickey/backbone-0.9.1.js
Externs for Backbone.js and Underscore.js
View backbone-0.9.1.js
/*
* @fileoverview Externs for backbone-0.9.1.js
*
* built with http://www.dotnetwise.com/Code/Externs/index.html
* see also: http://blog.dotnetwise.com/2009/11/closure-compiler-externs-extractor.html
* via: http://code.google.com/p/closure-compiler/wiki/FAQ#How_do_I_write_an_externs_file?
*
* Note: when building via that page, you first need to load in underscrore.js, as that's a dependency.
* also, after running the extern for Backbone, you need to manually run it for: