Skip to content

Instantly share code, notes, and snippets.

View cadorn's full-sized avatar

Christoph cadorn

View GitHub Profile
@cadorn
cadorn / WorkspaceActivation.md
Last active August 29, 2015 14:01
workspace activation

You activate a workspace by placing environment variables into your shell and modifying the PATH.

Shell environment variables represent the root config layer and all config resolving must happen from this base layer. If any code in your codebase must resolve config info it MUST have access to environment variables directly or indirectly or at the very least to the root path of the workspace so the environment variables may be established by loading and parsing the raw files.

Any config resolution logic must in its entirety be seeded by the environment variables and may then branch out with arbitrary logic. Ideally further config resolution layers follow rules and patterns that me be shared across implementations.

pio conventions

Given a file tree such as:

@cadorn
cadorn / Invitation.md
Last active April 18, 2018 03:19
Weekly `devcomp.io` meeting

Collaboration on packages is the precursor to an entire new paradigm of collaborative system development.

Join a group of people interested in collaborative realtime distributed system development and associated tooling.

You recognize that it takes many small components to make a large system and that there is no adequate open source tooling to assist with the creative process of modelling complex systems and making them a reality.

Time: Every Wednesday 10am - 11am PST

Where: Google Hangouts on Air (links will be sent to mailing list every week)

@paulrouget
paulrouget / ff.md
Last active May 14, 2024 02:30
Hacking Firefox
@xeoncross
xeoncross / ajax.js
Last active August 3, 2023 06:06
Simple, cross-browser Javascript POST/GET xhr request object. Supports request data and proper AJAX headers.
/**
* IE 5.5+, Firefox, Opera, Chrome, Safari XHR object
*
* @param string url
* @param object callback
* @param mixed data
* @param null x
*/
function ajax(url, callback, data, x) {
try {
@algal
algal / nginx-cors.conf
Created April 29, 2013 10:52
nginx configuration for CORS (Cross-Origin Resource Sharing), with an origin whitelist, and HTTP Basic Access authentication allowed
#
# A CORS (Cross-Origin Resouce Sharing) config for nginx
#
# == Purpose
#
# This nginx configuration enables CORS requests in the following way:
# - enables CORS just for origins on a whitelist specified by a regular expression
# - CORS preflight request (OPTIONS) are responded immediately
# - Access-Control-Allow-Credentials=true for GET and POST requests
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active March 1, 2026 01:02
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@max-mapper
max-mapper / helloworld.js
Created November 27, 2012 06:55
droneduino
var serialport = require('node-serialport')
var sp = new serialport.SerialPort("/dev/ttyO3", {
parser: serialport.parsers.raw,
baud: 9600
})
sp.on('data', function(chunk) {
console.log(chunk.toString('hex'), chunk.toString(), chunk)
})
@domenic
domenic / q-nexttick-times.md
Created May 27, 2012 06:30
Q test suite nextTick results

Comparing Different Implementations of process.nextTick using the Q test suite.

Used: q-spec.js@a1a416.

Implementations compared:

Based on MessageChannel

This is currently in Q:

@aantix
aantix / gist:1999816
Created March 8, 2012 09:08
Remote Pair Programming sucks. Here's how to solve it.

REAL WORLD SCENARIO (blinking lights)

Mr. Tom Dev wants to remote pair program with Mr. Todd Programmer. Tom is in New York, Todd is in San Francisco. They’re working on yet another blog written in Ruby. Tom fires up Rubymine, Todd fires up TextMate.

Todd’s editor quickly alerts him that he is connected with Tom and that their projects are out of sync. The plugin gives them each the option of using Tom’s file versions, Todd’s files, or performing a git pull request. They both do a git pull and are back in sync.

Todd quickly opens the User model in Rubymine with cmd-shift-N and Todd quickly sees that same file opened in Textmate. Todd then highlights a method that has been failing a test and Tom sees that highlight. Todd makes the change to the file, clicks cmd-s, and that file change is synced over to Tom.

Tom thought there was a secondary change needed in the Profile model, so he hits cmd-T, opens the Profile model and Todd sees that file opened in Rubymine. Todd tells Tom that he’s smoking catn

@coolaj86
coolaj86 / hybrid-commonjs-browser-module.js
Created March 5, 2012 17:39
A module pattern for CommonJS / NodeJS and Browser / Pakmanager / RequireJS
(function (exports) {
"use strict";
exports.Foo = 'Bar';
}('undefined' !== typeof exports && exports || new Function('return this')()));
// Note: A common mistake in this pattern is to assume that `this` is the global `window`,
// but even when running in a non-strict context `this` will not be `window` when using a