Skip to content

Instantly share code, notes, and snippets.

@joscas
joscas / bibtex.png
Created July 26, 2018 17:36 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@joscas
joscas / keybase.md
Last active November 2, 2019 19:21

Keybase proof

I hereby claim:

  • I am joscas on github.
  • I am jcasals (https://keybase.io/jcasals) on keybase.
  • I have a public key ASDrajF6JtU_UxlAyR-Ia6APWIdaJ5kbFp9OK8madljL6go

To claim this, I am signing this object:

@joscas
joscas / vault.sol
Created August 12, 2016 10:22 — forked from Arachnid/vault.sol
/**
* Author: Nick Johnson <arachnid at notdot.net>
*
* WARNING: This contract is new and thus-far only lightly tested. I'm fairly
* confident it operates as described, but you may want to assure yourself of
* its correctness - or wait for others to do so for you - before you trust your
* ether to it. No guarantees, express or implied, are provided - use at your
* own risk.
*
* @dev Ether vault contract. Stores ether with a 'time lock' on withdrawals,
@joscas
joscas / chat_messages.sh
Last active November 29, 2015 13:11
Some inserts for Cassandra chat App
#!/bin/bash
cqlsh <<CQL
USE chat_app;
INSERT INTO chat_messages (from_user, to_user, time, body, class, message_id )
VALUES ( 'john', 'mike', now(), 'Hi Mike!', 'family', blobAsUuid(timeuuidAsBlob(now()))) ;
INSERT INTO chat_messages (from_user, to_user, time, body, class, message_id )
VALUES ( 'mike', 'john', now(), 'Hi John!', 'family', blobAsUuid(timeuuidAsBlob(now()))) ;
INSERT INTO chat_messages (from_user, to_user, time, body, class, message_id )
VALUES ( 'john', 'mike', now(), 'How are you?', 'family', blobAsUuid(timeuuidAsBlob(now()))) ;
INSERT INTO chat_messages (from_user, to_user, time, body, class, message_id )
@joscas
joscas / c_chat.sh
Created June 21, 2014 10:33
CQL Commands for a Cassandra based Chat App
#!/bin/bash
cqlsh <<CQL
CREATE KEYSPACE chat_app WITH REPLICATION = {'class':'SimpleStrategy', 'replication_factor':1};
USE chat_app;
CREATE TABLE chat_messages (
message_id uuid,
from_user text,
to_user text,
body text,
class text,
#!/usr/bin/env ruby
# Lean Architecture example in Ruby - with ContextAccessor
# This example keeps interaction state in a "current context", represented
# by a ContextAccessor module. This can be mixed in to any class that needs
# access to the current context. It is implemented as a thread-local variable.
module ContextAccessor
def context
Thread.current[:context]