Skip to content

Instantly share code, notes, and snippets.

View joshuakfarrar's full-sized avatar
💻
EitherT[IO, Throwable, Human]

Joshua K. Farrar joshuakfarrar

💻
EitherT[IO, Throwable, Human]
View GitHub Profile
# IntelliJ .idea directory
**/.idea/workspace.xml
**/.idea/tasks.xml
# Built application files
*.apk
*.ap_
# Files for the Dalvik VM
*.dex
@joshuakfarrar
joshuakfarrar / queue.js
Created June 15, 2014 18:00
queue written using TDD
function Queue() {
this.elements = [];
}
Queue.prototype.getSize = function() {
return this.elements.length;
}
Queue.prototype.push = function(element) {
this.elements.push(element);
var blogify = function(opt) {
function md2html(file, enc, callback) {
var self = this;
fs.readFile('./public/index.html', function(err, template) {
var newFile = file.clone(),
contents = Mustache
.render(String(template), {
content: marked(String(file.contents))
});
@Override
public UserRefreshResult call() throws InterruptedException {
try {
checkCacheForUser();
} catch (UserNotCachedException e) {
tryCachingUser();
} catch (ApiRequestForUserAlreadyStartedException e) {
logger.warn("There is already a registration in progress, ignoring");
return UserRefreshResult.IN_PROGRESS;
}
package main;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.*;
import java.net.Socket;
public class ClientTest {
blackjack:node-engines-test jfarrar$ node -v
v0.10.29
blackjack:node-engines-test jfarrar$ cat package.json
{
"name": "node-engines-test",
"version": "0.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
JWS payload message: Hello world!
JWS header: {"alg":"HS256","cty":"text\/plain"}
HMAC key: a0a2abd8-6162-41c3-83d6-1cf559b46afc
Serialised JWS object: eyJhbGciOiJIUzI1NiIsImN0eSI6InRleHRcL3BsYWluIn0.SGVsbG8gd29ybGQh.nvg_EuyKXSiDGl9dzyDe6MT94218sSRjWFHkKbgzsB8
JWS object successfully parsed
Verified JWS signature!
Recovered payload message: Hello world!
Process finished with exit code 0
module.exports = Tokenizer;
var i = 0;
// states
var TEXT = i++,
IN_KEY = i++,
BEFORE_VALUE = i++,
IN_VALUE = i++
# drop and recreate your collection
> db.whatever_stuff.drop()
true
> db.createCollection('whatever_stuff')
{ "ok" : 1 }
# then run this
mongoimport -d test -c prod_registration_events --file whatever.json
git log --graph --oneline --all --decorate