Skip to content

Instantly share code, notes, and snippets.

@jnwng
jnwng / grid.css
Created October 29, 2012 08:48 — forked from JeffreyWay/grid.css
Simple CSS Grid in Stylus
full_width = 80
columns = 12
gutter = 1
.container
width unit(full_width, '%')
margin auto
overflow hidden
div[class^="grid_"]
@jnwng
jnwng / .gitignore
Created November 11, 2012 08:06 — forked from karmi/.gitignore
Bootstrap, install and configure ElasticSearch with Chef Solo
.DS_Store
tmp/
@jnwng
jnwng / my_cookbook-attributes-default.rb
Last active December 15, 2015 20:19
Substitute file dashes for slashes (like they should be to override node attributes)
if default['postgresql']['version'] == "9.1"
default['postgresql']['main_dir'] = "foo"
else
default['postgresql']['main_dir'] = "bar"
@jnwng
jnwng / RESULT
Created May 5, 2013 18:35
Default
#overrides-mixin {
float: right;
}
#uses-default-property {
float: left;
}
@jnwng
jnwng / gist:9928902
Created April 2, 2014 06:27
keybase.md
### Keybase proof
I hereby claim:
* I am jnwng on github.
* I am jnwng (https://keybase.io/jnwng) on keybase.
* I have a public key whose fingerprint is 0164 461A 15EA FFD8 EB95 42FC C7A1 BF5F 66AE 08DB
To claim this, I am signing this object:
@jnwng
jnwng / quotes.js
Created October 27, 2014 20:01
Changing matching quotes
var fs = require('fs');
var esprima = require('esprima');
var input = process.argv[2];
var content = fs.readFileSync(input, 'utf-8');
var tokens = esprima.parse(content, {
tokens: true,
range: true
}).tokens;
function convert(literal) {
@jnwng
jnwng / codemod-amd.js
Last active September 21, 2015 19:47
Unwrapping Require.JS style AMD declarations.
module.exports = function(file, api) {
const j = api.jscodeshift;
const makeModuleExports = (objExpr) => {
return j.assignmentExpression(
'=',
j.memberExpression(
j.identifier('module'),
j.identifier('exports')
),
@jnwng
jnwng / transform.js
Created September 28, 2015 05:24
Origami Codemod
module.exports = function(file, api) {
const j = api.jscodeshift;
const b = j.types.builders;
const {astNodesAreEquivalent} = j.types;
var root = j(file.source);
const keys = ['to', 'initialize'];
const getRequireCall = (path, moduleName) => {