Skip to content

Instantly share code, notes, and snippets.

View kazu69's full-sized avatar
:octocat:
⭐️ 🚀 🍻 🍶

kazu69 kazu69

:octocat:
⭐️ 🚀 🍻 🍶
View GitHub Profile
@kazu69
kazu69 / Gruntfile.js
Last active August 29, 2015 13:56
load-grunt-config sample
module.exports = function(grunt, options) {
var path = require('path');
require('load-grunt-config')(grunt, {
configPath: path.join(process.cwd(), 'grunt'), //path to task.js files, defaults to grunt dir
init: true, //auto grunt.initConfig
config: { //additional config vars
test: false
},
loadGruntTasks: { //can optionally pass options to load-grunt-tasks. If you set to false, it will disable auto loading tasks.
config: require('./package.json'),
bundle exec berks install
// ----
// Sass (v3.3.0.rc.4)
// Compass (v1.0.0.alpha.18)
// ----
@function color-diff($color-a, $color-b) {
$hue: hue($color-a) - hue($color-b);
$saturation: saturation($color-a) - saturation($color-b);
$lightness: lightness($color-a) - lightness($color-b);
###
css-sprite
https://github.com/kazu69/css-sprite
Copyright (c) 2014 kazu69
Licensed under the MIT license.
###
module.exports = (grunt) ->
'use strict'
# cson to json
node_modules/cson/bin/cson2json data.cson
{"abc":["a","b","c"],"a":{"b":"c"}}
node_modules/cson/bin/json2cson data.json
{
abc: [
"a"
"b"
"c"
node_modules/json5/lib/cli.js -c data.json5
cat data.json
{
"foo": "bar",
"while": true,
"this": "is a multi-line string",
"here": "is another",
"hex": 3735928559,
"half": 0.5,
"delta": 10,
@kazu69
kazu69 / SassMeister-input.scss
Created March 9, 2014 17:02
Generated by SassMeister.com.
// ----
// Sass (v3.3.0)
// Compass (v1.0.0.alpha.18)
// ----
.badge {
@at-root .info { content: 'info'; }
@at-root .info {
.page {
content: 'page';
@kazu69
kazu69 / d.js
Created March 12, 2014 04:28
ES6 generators function
function* double(x) {
while(true) {
x = x * 2;
yield x;
}
}
var g = double(2);
console.log(g.next()); // # => 4
console.log(g.next()); // # => 8
@kazu69
kazu69 / example.js
Last active August 29, 2015 13:57
koa.js yield order
var koa = require('koa');
var app = koa();
app.use(function *(next){
console.log(1);
yield next;
console.log(6);
});
@kazu69
kazu69 / error.js
Created March 12, 2014 04:59
koa.js error handling sample
var koa = require('koa');
var app = koa();
app.use(function *(next){
try {
yield next;
}
catch (err) {
console.log(err);
this.status = err.status || 500;