Skip to content

Instantly share code, notes, and snippets.

Stability ratings: 0-5
0 - Deprecated. This feature is known to be problematic, and changes are
planned. Do not rely on it. Use of the feature may cause warnings. Backwards
compatibility should not be expected.
1 - Experimental. This feature was introduced recently, and may change
or be removed in future versions. Please try it out and provide feedback.
If it addresses a use-case that is important to you, tell the node core team.
@Happy-Ferret
Happy-Ferret / .mozconfig
Created January 11, 2017 13:38 — forked from EricRahm/.mozconfig
Example mozconfigs
ac_add_options --enable-debug
ac_add_options --enable-dmd
# NB: ccache disabled for comparitive build time testing.
#ac_add_options --with-ccache=/usr/bin/ccache
MOZ_MAKE_FLAGS="-j12"
export LD="/usr/bin/gold"
# For gcc-6.3.0
@Happy-Ferret
Happy-Ferret / menu.js
Created January 12, 2017 09:50
Add action button to main menu panel
var button = buttons.ActionButton({
id: "cmd-link",
label: "Open commandline",
icon: {
"16": "./icon.svg",
"32": "./icon.svg",
"64": "./icon.svg"
},
onClick: handleClick
});
@Happy-Ferret
Happy-Ferret / prettyjson
Created January 23, 2017 16:21 — forked from expandrive/prettyjson
Take JSON from stdin and dump it to stdout in a more readable form
#!/usr/bin/python
# From http://stackoverflow.com/questions/352098/how-to-pretty-print-json-script
# To install paste this into a file named prettyjson that lives in your PATH
# e.g.
# sudo touch /usr/bin/prettyjson
# sudo open -t /usr/bin/prettyjson
# paste this file and save
# sudo chmod +x /usr/bin/prettyjson
"""
@Happy-Ferret
Happy-Ferret / pull_zmq.py
Created February 12, 2017 09:56 — forked from mgunneras/pull_zmq.py
Publish data from file or stdin to a zmq socket
#! /usr/bin/env python
"""
Prints data from zmq PULL socket to stdout
"""
import zmq
import sys
def get_socket(host, port):
context = zmq.Context()
@Happy-Ferret
Happy-Ferret / Enhance.js
Created February 26, 2017 08:17 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@Happy-Ferret
Happy-Ferret / broker.go
Created February 28, 2017 08:41 — forked from maliqq/broker.go
Golang message broker
package protocol
import (
"fmt"
"log"
)
// pubsub
type Broker struct {
Send map[string]*chan *Message
@Happy-Ferret
Happy-Ferret / gist:adb5d4bbb552aa9bd2b43fefcd89c576
Created March 2, 2017 06:25 — forked from dmitshur/gist:6927554
How to `go get` private repos using SSH key auth instead of password auth.
$ ssh -A vm
$ git config --global url."[email protected]:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "[email protected]:"]
	insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
@Happy-Ferret
Happy-Ferret / es6-dom-extend.js
Created March 17, 2017 10:00 — forked from hemanth/es6-dom-extend.js
Extend DOM elements ES6
class SmartButton extends HTMLButtonElement {
constructor() {}
}
let sb = new SmartButton();
document.body.appendChild(sb);
/*
I get the below error:
TypeError: Failed to execute 'appendChild'