Skip to content

Instantly share code, notes, and snippets.

View binarytemple's full-sized avatar

Bryan Hunt binarytemple

  • The mountains of mourne
View GitHub Profile
@binarytemple
binarytemple / gist:379a5c91301f32f8c3cc
Created December 1, 2015 16:57
notesExport.applescript
on buildTitle(originalText)
set normalizedText to my replace(originalText, ":", "-")
set finalTitle to my firstChars(normalizedText, 100)
return finalTitle
end buildTitle
on replace(originalText, fromText, toText)
set AppleScript's text item delimiters to the fromText
set the item_list to every text item of originalText
set AppleScript's text item delimiters to the toText
export KERL_CONFIGURE_OPTIONS="--disable-hipe --enable-smp-support --enable-threads --enable-kernel-poll --enable-darwin-64bit --with-ssl=/usr/local"
export CFLAGS="-DOPENSSL_NO_EC=1"
@binarytemple
binarytemple / hipchat_bot.js
Created November 28, 2015 23:58 — forked from powdahound/hipchat_bot.js
Basic XMPP bot example for HipChat using node.js
// Basic XMPP bot example for HipChat using node.js
// To use:
// 1. Set config variables
// 2. Run `node hipchat_bot.js`
// 3. Send a message like "!weather 94085" in the room with the bot
var request = require('request'); // github.com/mikeal/request
var sys = require('sys');
var util = require('util');
@binarytemple
binarytemple / create-ta-bucket-type.sh
Last active November 26, 2015 13:57
create TS bucket-type required by unit-tests
#!/bin/bash
cat <<END | sudo su - riak -
riak-admin bucket-type create GeoCheckin '{"props":{"n_val":1, "table_def": " CREATE TABLE GeoCheckin ( geohash varchar not null, user varchar not null, time timestamp not null, weather varchar not null, temperature double, uv_index sint64, observed boolean not null, PRIMARY KEY( (geohash, user, quantum(time, 15, 'm')), geohash, user, time)) "}}'
END
cat <<END | sudo su - riak -
riak-admin bucket-type activate GeoCheckin
END
@binarytemple
binarytemple / tanodb-preflist.markdown
Last active January 23, 2018 12:33 — forked from angrycub/preflist.erl
Testing tanodb preflist generation

tanodb is a distributed in memory key value store built on top of riak_core.

It is used as the example code for the Little Riak Core Book.

(kudos to @cv for the original version)

I found the following piece of code in a gist, but when I tried to execute it under taminodb, it returned an empty array.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>dadsa</title>
</head>
<body>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>dadsa</title>
</head>
<body>
@binarytemple
binarytemple / calendar_time.py
Last active October 22, 2015 18:11
calculate every date on a 7 day inteval
#!/usr/local/bin/python
from datetime import date, timedelta
d1 = date(2015,10,16)
d2 = date(2015,10,23)
dd = [(d1 + timedelta(days=x)).isoformat() for x in range(0,(d2-d1).days + 1,7)]
for d in dd:
export KERL_CONFIGURE_OPTIONS="--disable-hipe \
--enable-smp-support \
--enable-threads \
--enable-kernel-poll \
--enable-darwin-64bit"
export CFLAGS="-DOPENSSL_NO_EC=1"
import com.basho.riak.client.api.RiakClient;
import com.basho.riak.client.api.commands.kv.FetchValue;
import com.basho.riak.client.api.commands.kv.StoreValue;
import com.basho.riak.client.api.commands.kv.UpdateValue;
import com.basho.riak.client.api.convert.ConverterFactory;
import com.basho.riak.client.api.convert.JSONConverter;
import com.basho.riak.client.core.RiakCluster;
import com.basho.riak.client.core.RiakNode;
import com.basho.riak.client.core.query.Location;
import com.basho.riak.client.core.query.Namespace;