Skip to content

Instantly share code, notes, and snippets.

View d5's full-sized avatar

daniel d5

  • Los Angeles, CA
View GitHub Profile
'use strict';
const Etcd = require('node-etcd'),
P = require('bluebird'),
async = P.coroutine,
_ = require('lodash'),
assert = require('assert');
function keyToPath(key) {
return '/' + key.replace(/\./g, '/');
@d5
d5 / aerospike
Created July 26, 2015 23:07
Benchmarks: aerospike vs. aerospike-p
$ node main.js -h 192.168.59.103 -T 10s
Sun, 26 Jul 2015 23:01:55 GMT write(tps=5700 timeouts=0 errors=0) read(tps=5695 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=7486 timeouts=0 errors=0) read(tps=7464 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=6740 timeouts=0 errors=0) read(tps=6788 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=7827 timeouts=0 errors=0) read(tps=7820 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=7201 timeouts=0 errors=0) read(tps=7179 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=6062 timeouts=1 errors=0) read(tps=6021 timeouts=3 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=6329 timeouts=0 errors=0) read(tps=6341 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=6244 timeouts=0 errors=0) read(tps=6218 timeouts=0 errors=0)
Sun, 26 Jul 2015 23:01:55 GMT write(tps=7128 timeouts=0 errors=0) read(tps=7160 timeouts=0 errors=0)
@d5
d5 / micro-api-demo1.html
Created January 6, 2012 03:51
AES-256 Encryption AJAX Demo using Micro-API
<html>
<head>
<title>Micro-API Demo #1</title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript">
jQuery.support.cors = true;
function cancel_event_default(e) {
if(e.preventDefault) e.preventDefault();
// FastDelegate.h
// Efficient delegates in C++ that generate only two lines of asm code!
// Documentation is found at http://www.codeproject.com/cpp/FastDelegate.asp
//
// - Don Clugston, Mar 2004.
// Major contributions were made by Jody Hagins.
// History:
// 24-Apr-04 1.0 * Submitted to CodeProject.
// 28-Apr-04 1.1 * Prevent most unsafe uses of evil static function hack.
// * Improved syntax for horrible_cast (thanks Paul Bludov).
@d5
d5 / gist:1808375
Created February 12, 2012 13:05
Get the first index of type in the std::tuple<>
#include <tuple>
// ...
template<typename T, typename C, std::size_t I>
struct tuple_index_r;
template<typename H, typename ...R, typename C, std::size_t I>
struct tuple_index_r<std::tuple<H, R...>, C, I>
: public std::conditional<std::is_same<C, H>::value,
@d5
d5 / test1.txt
Last active December 29, 2015 21:09
test1's content
Hello, World!
testsetsetsetset
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="ko" xml:lang="ko">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=880" />
<link rel="shortcut icon" type="image/x-icon" href="http://img.naver.net/static/www/favicon.ico" />
<title>네이버 :: 나의 경쟁력, 네이버</title>
@d5
d5 / test2.txt
Last active December 29, 2015 21:19
This is a test.
Hello, <%= name %>!
<% print(a * b) %>
@d5
d5 / gist:7956153
Last active December 31, 2015 07:49
hello, {{ name }}!??