Skip to content

Instantly share code, notes, and snippets.

@oodavid
oodavid / README.md
Last active April 6, 2024 18:45 — forked from aronwoost/README.md
Deploy your site with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
@mbostock
mbostock / README.md
Last active June 7, 2023 18:33
Underscore’s Equivalents in D3

Collections

each(array)

Underscore example:

_.each([1, 2, 3], function(num) { alert(num); });
@dciccale
dciccale / README.md
Last active October 22, 2021 21:52
Tiny Cross-browser DOM ready function in 111 bytes of JavaScript

DOM Ready

Tiny Cross-browser DOM ready function in 111 bytes of JavaScript.

@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
@staltz
staltz / introrx.md
Last active May 2, 2024 12:31
The introduction to Reactive Programming you've been missing
@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
@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
;;
@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')
})

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
@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