Skip to content

Instantly share code, notes, and snippets.

@DrBoolean
DrBoolean / mcft.js
Created December 30, 2015 04:44
Monoidal Contravariant Functors and Transducers
const daggy = require('daggy');
const {foldMap} = require('pointfree-fantasy')
const {concat, toUpper, prop, identity, range, compose} = require('ramda');
// Contravariant functors usually have this shape F(a -> ConcreteType).
// In other words, some type holding a function which is parametric on its input, but not output.
// They don't always have that shape, but it's a good intuition
// Covariant functors are what we're used to, which are parametric in their output
//================================================================
@rastermanden
rastermanden / psql2markdown
Created March 11, 2015 20:26
termial alias to convert psql output to markdown tables
alias psql2markdown=" sed 's/+/|/g' | sed 's/^/|/' | sed 's/$/|/' | grep -v rows | grep -v '||'"
@kugaevsky
kugaevsky / revert.sh
Last active July 4, 2018 09:06
Reverting back to node 0.10.36 on Mac OS X with Homebrew
$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
$ brew install node
$ npm install -g npm@latest

Disclaimer: This is an unofficial post by a random person from the community. I am not an official representative of io.js. Want to ask a question? open an issue on the node-forward discussions repo

io.js - what you need to know

io-logo-substack

  • io is a fork of node v0.12 (the next stable version of node.js, currently unreleased)
  • io.js will be totally compatible with node.js
  • the people who created io.js are node core contributors who have different ideas on how to run the project
  • it is not a zero-sum game. many core contributors will help maintain both node.js and io.js
@LukeChannings
LukeChannings / handlebars-select-helper.js
Last active March 29, 2023 12:45
A select helper for handlebars
Handlebars.registerHelper("select", function(value, options) {
return options.fn(this)
.split('\n')
.map(function(v) {
var t = 'value="' + value + '"'
return ! RegExp(t).test(v) ? v : v.replace(t, t + ' selected="selected"')
})
.join('\n')
})
@elben
elben / understanding-transducers.clj
Last active February 14, 2021 10:55
Understanding Transducers. See README below.
(ns my-transducers.core
(:require [clojure.core.async :as async]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Understanding Transducers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; This is the source code for the blog post Understanding Transducers, found
;; here: http://elbenshira.com/blog/understanding-transducers
;;
@markkelnar
markkelnar / gist:ebc2f147ce70116991b2
Created August 6, 2014 01:23
PHP lint checker - pre commit hook
#!/bin/bash
# Put this file in .git/hooks/pre-commit
# Change it to be executable! If you don't do this, it won't work
# chmod +x .git/hooks/pre-commit
git diff-index --diff-filter=ACMR --name-only --cached HEAD |
grep '.php$' |
xargs -tn1 php -l
if (( $? )); then
@staltz
staltz / introrx.md
Last active April 19, 2024 18:49
The introduction to Reactive Programming you've been missing
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else