Skip to content

Instantly share code, notes, and snippets.

Magnus magnli10

Block or report user

Report or block magnli10

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Summary: .global (/g) and .sticky (/y)

/g /y /yg
.exec() at .lI or later at .lI same as /y
.test() at .lI or later at .lI same as /y
.replace() ignores & resets .lI at .lI /g w/o gaps
.replaceAll() ignores .lI TypeError /g w/o gaps
.search() no effect no effect no effect
.match() Array of group 0 captures like .exec() /g w/o gaps
alryaz /
Last active Aug 18, 2019
First attempt at developing homeassistant-discoverable MiScale integration
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import binascii
import time
import os
import csv
import sys
import json
squidpickles /
Created Jan 27, 2018
Multi-platform (amd64 and arm) Kubernetes cluster

Multiplatform (amd64 and arm) Kubernetes cluster setup

The official guide for setting up Kubernetes using kubeadm works well for clusters of one architecture. But, the main problem that crops up is the kube-proxy image defaults to the architecture of the master node (where kubeadm was run in the first place).

This causes issues when arm nodes join the cluster, as they will try to execute the amd64 version of kube-proxy, and will fail.

It turns out that the pod running kube-proxy is configured using a DaemonSet. With a small edit to the configuration, it's possible to create multiple DaemonSets—one for each architecture.


Follow the instructions at for setting up the master node. I've been using Weave Net as the network plugin; it see

paulirish / server-timing-demo.js
Last active Jul 31, 2018
Demo of server timing values. visualized in chrome devtools
View server-timing-demo.js
// see for screenshot:
const http = require('http');
function requestHandler(request, response) {
const headers = {
'Server-Timing': `
sql-1;desc="MySQL lookup Server";dur=100,
sql-2;dur=900;desc="MySQL shard Server #1",
PhilKershaw / gist:2171814
Created Mar 23, 2012
Simple example of using 2-legged OAuth in Node.js (requires node-oauth)
View gist:2171814
var express = require('express');
var oauth = require('oauth');
var app = express.createServer();
var key = "[api-key]";
var secret = "[api-secret]";
var request = new oauth.OAuth(null, null, key, secret, '1.0', null, 'HMAC-SHA1');
app.get('/api-request', function(req, res){
kogakure / .gitignore
Created Jul 17, 2009
Git: .gitignore file for LaTeX projects
View .gitignore
You can’t perform that action at this time.