Skip to content

Instantly share code, notes, and snippets.

@axdg
axdg / keybase.md
Last active October 30, 2017 00:29

Keybase proof

I hereby claim:

  • I am axdg on github.
  • I am axdg (https://keybase.io/axdg) on keybase.
  • I have a public key ASC4oPKwL78lKKtxU2nErqNj9N3DA0Uu1H_v2_1wUtWKgwo

To claim this, I am signing this object:

@axdg
axdg / index.js
Last active February 2, 2016 08:27
front-matter-delim-parsing
var Benchmark = require('benchmark');
var re = /^---\r?\n/;
var text = '---\r\nsomeotherpartofthestring';
var suite = new Benchmark.Suite;
suite.add('String.prototype.indexOf()', function() {
return (text.indexOf('---\n') !== -1) ||
(text.indexOf('---\r\n') !== -1);
});
@axdg
axdg / try-deku.js
Created January 25, 2016 16:38 — forked from kogai/try-deku.js
/** @jsx element */
import {dom, element} from '../src'
import {createStore, combineReducers} from 'redux'
let {createRenderer} = dom
let myReducer = (state = { message: 'hello, world', count: 0 }, action)=> {
switch (action.type) {
case 'CLICKED':
return {
message: `hello, diff-${state.count}`,
@axdg
axdg / bennckmarks.txt
Last active January 25, 2016 14:31
node-front-matter-benchmarks
regular post:
front-matter x 127,473 ops/sec ±3.43% (74 runs sampled)
gray-matter x 143,285 ops/sec ±2.16% (79 runs sampled)
dsfm x 176,789 ops/sec ±2.44% (79 runs sampled)
complex front-matter:
front-matter x 3,299 ops/sec ±2.05% (79 runs sampled)
gray-matter x 4,694 ops/sec ±2.03% (80 runs sampled)
dsfm x 4,677 ops/sec ±2.23% (77 runs sampled)
github.com/axdg/echo
BenchmarkEcho_Param 20000000 114 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param5 10000000 217 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param20 2000000 634 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_ParamWrite 5000000 244 ns/op 16 B/op 1 allocs/op
BenchmarkEcho_GithubStatic 10000000 151 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_GithubParam 5000000 258 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_GithubAll 30000 54910 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_GPlusStatic 20000000 107 ns/op 0 B/op 0 allocs/op
@axdg
axdg / 09212015_ghttprb.txt
Created September 21, 2015 06:30
go-http-routing-benchmark run
PASS
BenchmarkEcho_Param 10000000 129 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param 20000000 114 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param5 10000000 244 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param5 10000000 223 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param20 2000000 640 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param20 3000000 519 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_ParamWrite 5000000 265 ns/op 16 B/op 1 allocs/op
BenchmarkGin_ParamWrite 5000000 268 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_GithubStatic 10000000 172 ns/op 0 B/op 0 allocs/op
@axdg
axdg / 09202015_ghttprb.txt
Created September 19, 2015 13:22
go-http-routing-benchmark run
BenchmarkEcho_Param 10000000 123 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param 10000000 138 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param5 5000000 240 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param5 5000000 246 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_Param20 2000000 738 ns/op 0 B/op 0 allocs/op
BenchmarkGin_Param20 3000000 579 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_ParamWrite 10000000 230 ns/op 16 B/op 1 allocs/op
BenchmarkGin_ParamWrite 5000000 264 ns/op 0 B/op 0 allocs/op
BenchmarkEcho_GithubStatic 10000000 133 ns/op 0 B/op 0 allocs/op
BenchmarkGin_GithubStatic 10000000 144 ns/op 0 B/op 0 allocs/op
@axdg
axdg / echo_hosts.go
Created June 29, 2015 18:10
Example subdomain routing in github.com/labstack/echo v1.0
package main
import (
"net/http"
"github.com/labstack/echo"
)
type Hosts map[string]http.Handler
function oligo(seq) {
// We'll create an array with some new methods.
// Upon creation, the nucleotide will also be formatted,
// To make sure that it is all uppercase.
var _this = seq.split('').map(function(base) {
return base.toUpperCase();
});
// Something to identify it as an oligo.