Skip to content

Instantly share code, notes, and snippets.

@aallan
aallan / mac-vendor.txt
Last active July 13, 2024 23:08
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?
@spinda
spinda / jsequalityimpl.md
Last active March 15, 2017 21:50
js equality implementation (in spidermonkey)

explanation of https://twitter.com/getify/status/780249160662605824 in terms of SpiderMonkey (Firefox) internals

edit: The tweet linked above has since been deleted, but the original code read something like:

' \t\n\r\u000c\u000b\uFEFF\u0020' == 0 // true
  1. The script is parsed and compiled to bytecode.
@MRuy
MRuy / white-base64-favicon.html
Created May 13, 2016 12:31
White base64 favicon html-code
<link rel="icon" href="data:image/gif;base64,R0lGODlhAQABAIAAAP7//wAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==">
@Cougar
Cougar / periodiccallback.py
Created January 31, 2016 21:29
Add run_now() method to tornado.ioloop.PeriodicCallback
import tornado.ioloop
class PeriodicCallback(tornado.ioloop.PeriodicCallback):
def run_now(self):
self.stop()
self._running = True
try:
return self.callback()
except Exception:
self.io_loop.handle_callback_exception(self.callback)
@datchley
datchley / es6-eventemitter.js
Last active June 7, 2021 03:40
A straight forward EventEmitter implemented in Javascript using ES6
let isFunction = function(obj) {
return typeof obj == 'function' || false;
};
class EventEmitter {
constructor() {
this.listeners = new Map();
}
addListener(label, callback) {
this.listeners.has(label) || this.listeners.set(label, []);
@skipme
skipme / gist:58470cf6f43b830cf572
Last active August 29, 2015 14:20
Cookies, MDN, addon SDK
var Cc = require("chrome").Cc;
var Ci = require("chrome").Ci;
var SERVICES_COOKIE = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
this.cookies = "";
var enumc = SERVICES_COOKIE.getCookiesFromHost("*.example.com");
while (enumc.hasMoreElements())
{
var cookie = enumc.getNext().QueryInterface(Ci.nsICookie2);
@trollknurr
trollknurr / vpnc-split-script
Last active February 19, 2024 14:12
openconnect vpn split routing sh script
#!/bin/sh
# Add one IP to the list of split tunnel
add_ip ()
{
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_ADDR=$1
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASK=255.255.255.255
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASKLEN=32
export CISCO_SPLIT_INC=$(($CISCO_SPLIT_INC + 1))
}
var gulp = require("gulp"),
streamqueue = require("streamqueue"),
less = require("gulp-less"),
autoprefixer = require("gulp-autoprefixer"),
minifyCss = require("gulp-minify-css"),
concat = require("gulp-concat"),
uglify = require("gulp-uglify"),
rename = require("gulp-rename"),
combine = require("stream-combiner2"),
es = require("event-stream"),
@NotSqrt
NotSqrt / settings_test_snippet.py
Last active May 1, 2022 01:34 — forked from nealtodd/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
import haystack
from django.core.management import call_command
from django.test.utils import override_settings
TEST_INDEX = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',