Skip to content

Instantly share code, notes, and snippets.

View intolerance's full-sized avatar
👋
while(1 < 2) { aG.work(); }

Allen Gammel intolerance

👋
while(1 < 2) { aG.work(); }
View GitHub Profile
@rsms
rsms / EventListener.d.ts
Created July 12, 2017 17:49
Better EventEmitter TypeScript interface
export class EventEmitter<Events, K = keyof Events|symbol> {
addListener(event: K, listener: (...args: any[]) => void): this;
on(event: K, listener: (...args: any[]) => void): this;
once(event: K, listener: (...args: any[]) => void): this;
removeListener(event: K, listener: (...args: any[]) => void): this;
removeAllListeners(event?: K): this;
setMaxListeners(n: number): this;
getMaxListeners(): number;
listeners(event: K): Function[];
emit(event: K, ...args: any[]): boolean;
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
@kevinold
kevinold / react-native-parse-xml-example.js
Created October 25, 2016 13:14 — forked from benvium/react-native-parse-xml-example.js
Parse XML Example using React Native.xmldom is a pure JavaScript implementation of an XML Parser. I've added it to window so that browser modules that require it will work. Tested on iOS and Android.
/**
*
* Before use, type:
* ```
* npm install xmldom --save
* ```
*/
window.DOMParser = require('xmldom').DOMParser;
@xiongjia
xiongjia / 0_main.cxx
Last active September 11, 2022 01:39
A simple sample of Boost Log #devsample #boost
/**
* A simple sample of Boost Log
*/
#pragma warning(push)
#pragma warning(disable:4819)
# include <boost/shared_ptr.hpp>
# include <boost/date_time/posix_time/posix_time_types.hpp>
# include <boost/log/trivial.hpp>
# include <boost/log/core.hpp>
@joshbirk
joshbirk / samplerest.js
Created February 3, 2012 19:57
Sample of using passport w/ mult strategies
var fs = require("fs")
var ssl_options = {
key: fs.readFileSync('privatekey.pem'),
cert: fs.readFileSync('certificate.pem')
};
var port = process.env.PORT || 3000;
var express = require('express');
var ejs = require('ejs');
var passport = require('passport')