Skip to content

Instantly share code, notes, and snippets.

View dashed's full-sized avatar
👨‍💻
Busy transpiling ☕ into ✨

Alberto Leal dashed

👨‍💻
Busy transpiling ☕ into ✨
View GitHub Profile
var structure = immstruct({turtles: []});
var TurtlesComponent = React.createClass({
componentWillMount: function() {
this.setState({turtlesCursor: structure.cursor()}
structure.on('swap', () =>
this.setState({turtlesCursor: structure.cursor()}));
@dashed
dashed / cliref.md
Created August 30, 2014 11:59 — forked from yunga/cliref.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20140825 \/      \/         \/     \/

"use strict";
/**
* Deps:
* npm install benchmark EventEmitter3
*/
var EventEmitter = require('events').EventEmitter;
var bus = new EventEmitter();
function nextTick(callback) {
// setTimeout(callback, 0);
var mori = require("mori");
function Calendar(appointments, previousCalendar) {
appointments = appointments;
var cal = {};
cal.add = function(appointment) {
var withAppointments = mori.conj(appointments, appointment);
return Calendar(withAppointments, cal);
@dashed
dashed / np.zsh
Created January 15, 2014 21:14 — forked from sindresorhus/np.sh
# npm publish with goodies
# `np` with an optional argument `patch`/`minor`/`major`/`<version>`
# defaults to `patch`
np() {
trash node_modules &>/dev/null;
git pull --rebase && \
npm install && \
npm test && \
npm version ${1:=patch} && \
npm publish && \
@dashed
dashed / gulpfile-env.js
Created January 7, 2014 12:38
Interesting and useful gulp snippets.
/*
From https://github.com/gulpjs/gulp/issues/101. Organize gulpfile.js using concept of environment variables.
1. Set up sub-tasks to behave in a certain according to env var; may be env agnostic.
2. Set up high-level tasks to run a group of sub-tasks to orchestrate a behaviour (testing, staging, prod, etc)
*/
var R = 0;
var ENV_SWITCH = void 0;
/* gulpfile.js - https://github.com/wearefractal/gulp */
var gulp = require('gulp');
var gutil = require('gulp-util');
var coffee = require('gulp-coffee');
var path = require('path');
var srcCoffeeDir = './coffee/';
var destDir = './src/';
@dashed
dashed / github-pandoc.css
Created September 26, 2013 13:42
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on Marked.app's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
@dashed
dashed / optimize.sh
Created December 10, 2012 06:45 — forked from ryansully/optimize.sh
image optimization script (pngcrush & jpegtran)
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
for png in `find $1 -iname "*.png"`; do
echo "crushing $png ..."
pngcrush -rem alla -reduce -brute "$png" temp.png