Skip to content

Instantly share code, notes, and snippets.

@phred
phred / pedantically_commented_playbook.yml
Last active February 26, 2025 14:19
Very complete Ansible playbook, showing off all the options
---
####
#### THIS IS OLD AND OUTDATED
#### LIKE, ANSIBLE 1.0 OLD.
####
#### PROBABLY HIT UP https://docs.ansible.com MY DUDES
####
#### IF IT BREAKS I'M JUST SOME GUY WITH
#### A DOG, OK, SORRY
####
@mharsch
mharsch / gist:5188206
Last active March 13, 2025 04:28
serve HLS (HTTP Live Streaming) content from node.js

HLS streaming from node

Provided that you already have a file or stream segmenter generating your .m3u8 playlist and .ts segment files (such as the ffmpeg 'hls' muxer), this little node server will serve up those files to an HLS compatible client (e.g. Safari). If you're using node for your streaming app already, this obviates the need to serve the HLS stream from a separate web server.

loosely based on https://gist.github.com/bnerd/2011232

// loosely based on https://gist.github.com/bnerd/2011232
// requires node.js >= v0.10.0
// assumes that HLS segmenter filename base is 'out'
// and that the HLS playlist and .ts files are in the current directory
@dsuch
dsuch / haproxy.conf
Created June 26, 2013 22:18
HAProxy config for URL-based rate limiting
# At most 10 concurrent connections from a client
acl too_fast fe_sess_rate ge 10
# Matches any path beginning with a given prefix
acl bursts_inclined path_beg -i /client1
# Effectively working as a delay mechanism for clients that are too fast
tcp-request inspect-delay 1000ms
# Fast-path - accept connection if it's not this troublesome client
@jbenet
jbenet / simple-git-branching-model.md
Last active May 3, 2025 18:07
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@oroce
oroce / elasticsearch-template.json
Created June 3, 2014 07:34
elastic-search.template
{
"template": "logstash-*",
"settings" : {
"index" : {
"store" : { "compress" : { "stored" : true, "tv": true } }
}
},
"mappings": {
"_default_": {
"_all": { "enabled": false },
@rwaldron
rwaldron / calibrate-servo.js
Last active August 29, 2015 14:02
Calibrating a continuous servo and external power warning
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
/*
Assuming a continuous servo is attached to pin 9,
this program can be called as:
node calibrate-servo.js
@mikeal
mikeal / gist:86920c314a9dd66db86b
Last active August 29, 2015 14:05
ONE-SHOT by NodeConf

ONE-SHOT is a "forkable conference" initially created by the organizer of NodeConf.

The main NodeConf events around the world are rather large productions and require a big commitment of time and financial risk. ONE-SHOT was created as a much simpler single day speaker series event that people around the world can pick up and run without a huge time commitment or considerable financial risk.

That first ONE-SHOT was run in London and events are now planned for Budapest, Brussels, and Oakland.

Ping @mikeal if you'd like to run an event, he'll give you instructions on how to fork the repository which includes the website, CFP instructions, and the Issue tracker can be used to accept talk proposals. Mikeal will also point "your city".nodeconf.com at the property gh-pages CNAME.

@ericelliott
ericelliott / essential-javascript-links.md
Last active March 22, 2025 17:28
Essential JavaScript Links
@hekike
hekike / server.js
Created January 11, 2015 13:25
Highland server with mongoose
var http = require('http');
var _ = require('highland');
var mongoose = require('mongoose');
var httpServer = http.createServer();
var server = _('request', httpServer, ['req', 'res']);
mongoose.connect('mongodb://localhost/test');
var UserSchema = new mongoose.Schema({
@chantastic
chantastic / on-jsx.markdown
Last active May 13, 2025 12:04
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't