Skip to content

Instantly share code, notes, and snippets.

View jmshoffs0812's full-sized avatar

Justin Shoffstall jmshoffs0812

  • Tallahassee, FL
View GitHub Profile
// New REPL session, v0.4.5
var d = new Date();
d // 'Thu, 07 Apr 2011 09:09:17 GMT'
// New session
Date.prototype.addDays = function(days){ this.setDate(this.getDate()+days); return this };
var d = new Date();
d // {}
// New session
@jmshoffs0812
jmshoffs0812 / gist:1155875
Created August 19, 2011 02:18
Find all words in a given list with three consecutive pairs of letters
// Derped original regex: /(aa|bb|cc|dd|ee|ff|gg|hh|ii|jj|kk|ll|mm|nn|oo|pp|qq|rr|ss|tt|uu|vv|ww|xx|yy|zz){3}/
// New regex provided by @ryan_richt
var fs = require('fs'),
lazy = require('lazy'), // https://github.com/pkrumins/node-lazy
re = new RegExp(/(([a-z])\2){3}/),
word;
new lazy(fs.createReadStream(process.argv[2] || '/usr/share/dict/words'))
.lines
@jmshoffs0812
jmshoffs0812 / gist:1163777
Created August 22, 2011 22:14 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job: Systems Engineer
Favorite Python project: http://python-requests.org
Favorite Conference: TXJS
Python Experience Level: Intermediate
import com.basho.riak.client.IRiakClient;
import com.basho.riak.client.IRiakObject;
import com.basho.riak.client.RiakException;
import com.basho.riak.client.RiakFactory;
import com.basho.riak.client.bucket.Bucket;
public class App
{
public static void main( String[] args )
{
@jmshoffs0812
jmshoffs0812 / gist:2970816
Created June 22, 2012 06:41
Newer Bucket Walk
import com.basho.riak.client.IRiakClient;
import com.basho.riak.client.IRiakObject;
import com.basho.riak.client.RiakException;
import com.basho.riak.client.RiakFactory;
import com.basho.riak.client.bucket.Bucket;
public class App
{
public static void main( String[] args )
{
package com.foo;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.basho.riak.client.IRiakClient;
import com.basho.riak.client.IRiakObject;
import com.basho.riak.client.RiakException;
import com.basho.riak.client.RiakFactory;
import com.basho.riak.client.bucket.Bucket;
PBStatusFun = fun() ->
VnodePids = [Pid || {_, Pid} <- riak_core_vnode_manager:all_index_pid(riak_kv_vnode)],
Links = [process_info(Pid, [links]) || Pid <- VnodePids],
WorkerPoolPids = [WPPid || [{links,[_, WPPid]}] <- Links],
WorkerPoolLinks = [process_info(Pid, [links]) || Pid <- WorkerPoolPids],
PoolboyPids = [PoolboyPid || [{links,[_, PoolboyPid]}] <- WorkerPoolLinks],
[poolboy:status(Pid) || Pid <- PoolboyPids]
end.
PBStatusFun = fun(Index) ->
### Keybase proof
I hereby claim:
* I am jmshoffs0812 on github.
* I am jshoffstall (https://keybase.io/jshoffstall) on keybase.
* I have a public key whose fingerprint is EE91 BE55 D8C8 439C 7050 AED7 F0FF 890A 820F C331
To claim this, I am signing this object: