Skip to content

Instantly share code, notes, and snippets.

View VandeurenGlenn's full-sized avatar
💭
I may write messy code.

Glenn Vandeuren VandeurenGlenn

💭
I may write messy code.
View GitHub Profile
@VandeurenGlenn
VandeurenGlenn / gist:06247c8a06c0840c79a2fdd532475eef
Created December 16, 2019 17:23 — forked from ciaranj/gist:9056285
A *working* (on Windows) UDP Multicast client & server with Node.Js v0.10.25 (I spent a *LOT* of time getting EINVAL and I still don't quite know why :/)
For my own sanity ;) Scraped from a variety of places, including: http://stackoverflow.com/questions/14130560/nodejs-udp-multicast-how-to?utm_medium=twitter&utm_source=twitterfeed
!Server
var news = [
"Borussia Dortmund wins German championship",
"Tornado warning for the Bay Area",
"More rain for the weekend",
"Android tablets take over the world",
"iPad2 sold out",
@VandeurenGlenn
VandeurenGlenn / get-npm-package-version
Created July 11, 2017 12:53 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@VandeurenGlenn
VandeurenGlenn / requestIdleCallback.js
Last active April 13, 2016 21:42 — forked from paullewis/requestIdleCallback.js
Shims rIC in case a browser doesn't support it.
/*!
* Copyright 2015 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@VandeurenGlenn
VandeurenGlenn / auto-deploy.md
Created February 9, 2016 22:00 — forked from domenic/0-github-actions.md
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with Travis

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

Create a compile script

You want a script that does a local compile to e.g. an out/ directory. Let's call this compile.sh for our purposes, but for your project it might be npm build or gulp make-docs or anything similar.

The out/ directory should contain everything you want deployed to gh-pages. That almost always includes an index.html.

@VandeurenGlenn
VandeurenGlenn / README.md
Created November 21, 2015 22:00 — forked from mbostock/.block
Twitter SVG Logo
@VandeurenGlenn
VandeurenGlenn / realTemplate.html
Created November 14, 2015 20:33 — forked from JanMiksovsky/realTemplate.html
Create a Polymer element using a real <template>, not a <dom-module>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="import" href="../components/polymer/polymer.html">
<template id="test-element">
Hello, <content></content>.
</template>
@VandeurenGlenn
VandeurenGlenn / nodejs.sh
Last active September 4, 2016 22:47 — forked from Gioyik/nodejs.sh
Script to cross compile NodeJS for ARMv7
#!/bin/sh -e
#Define our target device
export TARGET_ARCH="-march=armv7-a"
export TARGET_TUNE="-mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -mthumb-interwork -mno-thumb"
#Define the cross compilators on your system
export AR="arm-linux-gnueabi-ar"
export CC="arm-linux-gnueabi-gcc"
export CXX="arm-linux-gnueabi-g++"
@VandeurenGlenn
VandeurenGlenn / onStorage.js
Last active August 29, 2015 14:19 — forked from tomasperezv/gist:5175807
Example of listening to local storage changes
if (window.addEventListener) {
window.addEventListener("storage", onStorage, false);
} else {
window.attachEvent("onstorage", onStorage);
};
var onStorage = function(data) {
// Receive changes in the localStorage
}
/**
* simple JSONP support
*
* JSONP.get('https://api.github.com/gists/1431613', function (data) { console.log(data); });
* JSONP.get('https://api.github.com/gists/1431613', {}, function (data) { console.log(data); });
*
* gist: https://gist.github.com/gists/1431613
*/
var JSONP = (function (document) {
var requests = 0,