brew install mongodb
Set up launchctl to auto start mongod
$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
/usr/local/opt/mongodb/
is a symlink to /usr/local/Cellar/mongodb/x.y.z
(e.g., 2.4.9
)
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/10.0\ \(14A5309d\) | |
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport |
$ PGHOST=/var/run/postgresql go test -bench . -benchmem | |
BenchmarkPgxNativeSelectSingleShortString-8 100000 17873 ns/op 292 B/op 6 allocs/op | |
BenchmarkPgxStdlibSelectSingleShortString-8 100000 20602 ns/op 907 B/op 24 allocs/op | |
BenchmarkPgSelectSingleShortString-8 100000 17451 ns/op 120 B/op 8 allocs/op | |
BenchmarkPqSelectSingleShortString-8 100000 22604 ns/op 832 B/op 25 allocs/op | |
BenchmarkRawSelectSingleShortValue-8 100000 15735 ns/op 6 B/op 0 allocs/op | |
BenchmarkPgxNativeSelectSingleShortBytes-8 100000 17808 ns/op 314 B/op 7 allocs/op | |
BenchmarkPgxStdlibSelectSingleShortBytes-8 100000 20891 ns/op 933 B/op 25 allocs/op | |
BenchmarkPqSelectSingleShortBytes-8 50000 22005 ns/op 856 B/op 26 allocs/op | |
BenchmarkPgxNativeSelectSingleRow-8 100000 21577 ns/op 478 B/ |
/** | |
* This gulpfile will copy static libraries and a index.html file as well as | |
* merge, babelify and uglify the rest of the javascript project. | |
* | |
* TODO: | |
* - Separate media, libs and src with different watchers. | |
* - Media and libs should only be copied to dist if they are different sizes. | |
* | |
* The expected project is to be laid out as such: | |
* |
(function($, window, undefined) { | |
var InfiniteScroll = function() { | |
this.initialize = function() { | |
this.setupEvents(); | |
}; | |
this.setupEvents = function() { | |
$(window).on( | |
'scroll', | |
this.handleScroll.bind(this) |
'use strict' | |
const timeout = ms => new Promise(res => setTimeout(res, ms)) | |
function convinceMe (convince) { | |
let unixTime = Math.round(+new Date() / 1000) | |
console.log(`Delay ${convince} at ${unixTime}`) | |
} | |
async function delay () { |
/** | |
http://mythosil.hatenablog.com/entry/20111017/1318873155 | |
http://blog.dealforest.net/2012/03/ios-android-per-aes-crypt-connection/ | |
*/ | |
@interface NSData (AES) | |
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key; | |
- (NSData *)AES128DecryptedDataWithKey:(NSString *)key; | |
- (NSData *)AES128EncryptedDataWithKey:(NSString *)key iv:(NSString *)iv; |
cmake_minimum_required(VERSION 2.8) | |
function(use_llvm TARGET) | |
message("ARGC=\"${ARGC}\"") | |
message("ARGN=\"${ARGN}\"") | |
message("ARGV=\"${ARGV}\"") | |
message("ARGV0=\"${ARGV0}\"") | |
message("ARGV1=\"${ARGV1}\"") | |
endfunction() |
``` | |
// This code snippet shows how an external function can use a pattern like | |
// python's `try..except..else` with `.call`, `throw`, and reentry | |
contract TryExceptElsePatternUser { | |
address _sender; | |
function tryExceptElsePatternExample() | |
external // must be external | |
{ | |
if( msg.sender == address(this) ) { |
Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet.
Service discovery & registration is done via etcd.
elasticsearch-discovery@.service provides a dumb discovery service by registering an elasticsearch host if it should be up. elasticsearch-intelligent-discovery@.service registers the service only if it is running.
A service & timer unit for elasticsearch curator is provided which does some housekeeping.