Skip to content

Instantly share code, notes, and snippets.

@fgnass
fgnass / README.md
Created October 5, 2010 15:41
Supervisor for node.js
@fgnass
fgnass / LICENSE.txt
Created May 30, 2011 13:33 — forked from 140bytes/LICENSE.txt
display a loading spinner
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Felix Gnass <https://github.com/fgnass>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fgnass
fgnass / index.html
Created September 8, 2011 14:18
Amazon-to-SoundCloud Bookmarklet
<html>
<body style="font:14px Helvetica Neue">
This bookmarklet converts all Amazon search links on a page into SoundCloud links. Useful when listening to <a href="http://byte.fm">byte.fm</a>.
<p>
To install, add this link to your bookmarks toolbar: <a href="javascript:for(var i=0,a;a=document.links[i++];a.href=(a.href||'').replace(/amazon.*rds=(.*?)&.*/,'soundcloud.com/search?q=$1'));">⤻☁</a>
</p>
</body>
</html>
@fgnass
fgnass / LICENSE.txt
Created September 28, 2011 10:53 — forked from p01/LICENSE.txt
Sudoku Solver in 140bytes
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Mathieu 'p01' Henri <http://www.p01.org/releases/>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fgnass
fgnass / LICENSE.txt
Created October 4, 2011 08:44 — forked from 140bytes/LICENSE.txt
The Mandelbro™
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Felix Gnass <http://twitter.com/fgnass>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@fgnass
fgnass / download.php
Created September 5, 2012 11:29
HTTP download without curl or fopen wrappers
function download($url, $timeout=10) {
$host;
$path = '/';
$port = 80;
extract(parse_url($url));
if (isset($query)) $path .= '?'.$query;
$req = array(
"GET $path HTTP/1.1",
"Host: $host",
@fgnass
fgnass / ipalias.plist
Created February 26, 2013 09:05
Add 10.0.2.2 as alias for the loopback interface upon startup.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ipalias</string>
<key>ProgramArguments</key>
<array>
<string>ifconfig</string>
<string>lo0</string>
@fgnass
fgnass / README.md
Last active August 29, 2015 14:01
neteye.js

NETEYE JavaScript Code Style

This is JavaScript code style used at NETEYE. It's derived from the npm coding style which has been designed to reduce visual clutter and make bugs more apparent.

Indentation

Two-spaces. Tabs are better, but they look like hell in web browsers. And node uses 2 spaces, so that's that.

@fgnass
fgnass / JSXTransformer.js
Last active August 29, 2015 14:05
React + Picturefill
/**
* JSXTransformer v0.11.0-rc1
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.JSXTransformer=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
@fgnass
fgnass / stacktrace
Last active August 29, 2015 14:06
tap/difflet/charm error
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Stream.EventEmitter.addListener (events.js:179:15)
at Stream.pipe (stream.js:99:8)
at module.exports .../node_modules/tap/node_modules/difflet/node_modules/charm/index.js:38:15)
at difflet .../node_modules/tap/node_modules/difflet/index.js:41:17)
at Function.fn.compare .../node_modules/tap/node_modules/difflet/index.js:20:9)
at diffObject .../node_modules/tap/lib/tap-assert.js:398:50)
at assert .../node_modules/tap/lib/tap-assert.js:55:18)
at Function.equivalent .../node_modules/tap/lib/tap-assert.js:182:12)