- Introduction
- Functional Programming
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
//================================================================ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias psql2markdown=" sed 's/+/|/g' | sed 's/^/|/' | sed 's/$/|/' | grep -v rows | grep -v '||'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ 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 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 | |
;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder