Skip to content

Instantly share code, notes, and snippets.

View frank-dspeed's full-sized avatar
🇩🇪
I Engineer

Frank Lemanschik frank-dspeed

🇩🇪
I Engineer
View GitHub Profile
@companje
companje / socket.io-stream-server-to-browser.js
Created September 9, 2014 13:55
socket.io-stream from NodeJS Server to Browser
/////////////////////////////
// NodeJS Server
/////////////////////////////
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var ss = require('socket.io-stream');
var path = require('path');
@sigmonsays
sigmonsays / gist:ccaf7b56311921985648
Created September 23, 2014 04:54
bind routable IP to a container
NSPID=$(docker inspect -f '{{.State.Pid}}' $CONTAINER)
ip link add virtual0 link eth0 type macvlan mode bridge
ip link set virtual0 netns $NSPID
ip netns exec $NSPID ip addr add A.B.C.D/24 dev virtual0
ip netns exec $NSPID ip link set virtual0 up
ip netns exec $NSPID ip route del default
ip netns exec $NSPID ip route add default via A.B.C.1
@cnf
cnf / Dockerfile
Created May 26, 2015 18:47
VyOS Docker Build
FROM debian:squeeze
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update \
&& apt-get install -y wget \
&& wget -O - http://packages.vyos.net/vyos-pubkey.gpg | apt-key add - \
&& echo "deb http://backports.debian.org/debian-backports squeeze-backports main" > /etc/apt/sources.list.d/bp.list \
&& apt-get update \
&& apt-get -t squeeze-backports install -y squashfs-tools \
@smarr
smarr / truffle-material.md
Last active May 14, 2024 07:48
Truffle: Languages and Material
@KittyGiraudel
KittyGiraudel / bling.js
Last active September 29, 2019 03:33 — forked from paulirish/bling.js
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;
@leoj3n
leoj3n / Bootstrap--The-Good-Parts.md
Last active April 12, 2017 15:03
Bootstrap: The Good Parts

Bootstrap is hard to customize and rather bulky; when you enclude the entire library on your page, rarely are you utilizing all of the parts. Luckily, with the help of StealJS, we can load just the needed parts within a DoneJS application ON DEMAND and NON-DESTRUCTIVELY. You know how difficult it can be if you've tried to accomplish this in the past with old versions of Bootstrap within a framework of your choice. Well, if you're willing to adopt DoneJS (or at least the module loader StealJS), you'll be off to the races with a lightweight app that loads just the bare minmium of needed CSS and JS.

This guide will be broken into parts:

  • Installing DoneJS
  • Generating a new DoneJS project
  • Installing Boostrap v4
  • Installing Tether
  • Generating a new DoneJS component
  • Editing the package.json
@Xaekai
Xaekai / ipc.example.js
Created July 11, 2016 18:12
Example of Interprocess communication in Node.js through a UNIX domain socket
/*
**
** Example of Interprocess communication in Node.js through a UNIX domain socket
**
** Usage:
** server> MODE=server node ipc.example.js
** client> MODE=client node ipc.example.js
**
*/
@Rich-Harris
Rich-Harris / service-workers.md
Last active June 6, 2024 22:24
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@dmarcuse
dmarcuse / ClasspathHacker.java
Created September 14, 2016 21:14
Add jars to the classpath at runtime!
import java.io.File;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
/**
*
* @author apemanzilla
*
*/
var app = {
initialize: function() {
this.bindEvents();
},
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
onDeviceReady: function() {
app.receivedEvent('deviceready');