Skip to content

Instantly share code, notes, and snippets.

View metakeule's full-sized avatar
💭
I may be slow to respond.

metakeule metakeule

💭
I may be slow to respond.
  • Asunción / Paraguay
View GitHub Profile
@metakeule
metakeule / postgres.go
Created April 12, 2018 04:46 — forked from rivo/postgres.go
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
View postgres.go
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"
@metakeule
metakeule / main.cpp
Created April 4, 2018 06:18 — forked from cfillion/main.cpp
Bare-bone REAPER extension (prints Hello World! using the API)
View main.cpp
// Bare-bone REAPER extension
//
// 1. Grab reaper_plugin.h from https://raw.githubusercontent.com/reaper-oss/sws/master/reaper/reaper_plugin.h
// 2. Grab reaper_plugin_functions.h by running the REAPER action "[developer] Write C++ API functions header"
// 3. Grab WDL: git clone https://github.com/justinfrankel/WDL.git
// 4. Build then copy or link the binary file into <REAPER resource directory>/UserPlugins
//
// Linux
// =====
//
View latency.txt
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
@metakeule
metakeule / mapreduce.js
Created July 17, 2012 03:06 — forked from madhums/mapreduce.js
mapreduce using mongodb and mongoose
View mapreduce.js
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/db_name');
// map function
var map = function(){
emit(this.field_to_group_by, {
other_fields: this.other_fields
// list other fields like above to select them
})
}
@metakeule
metakeule / test.js
Created June 18, 2012 11:01 — forked from youurayy/test.js
Testing overloadability of native Object members
View test.js
var ps = [
'__defineGetter__', '__defineSetter__', 'valueOf',
'__lookupGetter__', '__lookupSetter__',
'constructor', 'hasOwnProperty',
'isPrototypeOf', 'propertyIsEnumerable',
'toLocaleString', 'toString' ];
var o = {};
for(var i = 0; i < ps.length; i++)
@metakeule
metakeule / observer.md
Created May 10, 2012 13:24 — forked from lloyd/observer.md
BrowserID Observer API
View observer.md

BrowserID "Observer" API

The BrowserID JavaScript API can be used by web pages to implement BrowserID authentication. Implementing BrowserID support consists of:

  1. registering callback functions that will be invoked when the user logs in or out via navigator.id.watch()
  2. invoking navigator.id.request() when the user clicks a login button on your site.
  3. invoking navigator.id.logout() when the user clicks a logout button on your site.
@metakeule
metakeule / Vagrantfile
Created March 13, 2012 17:57
Vagrant configuration
View Vagrantfile
##################################
### Custom additions from Krux
##################################
### Extensive documentation here:
### http://vagrantup.com/docs/vagrantfile.html
require 'etc'
owner = ENV['KRUX_MY_USERNAME'] || Etc.getlogin
hosts = {