Skip to content

Instantly share code, notes, and snippets.

View namehash.go
package ens
import (
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
)
func Namehash(name string) common.Hash {
@ryandotsmith
ryandotsmith / main.go
Created Jan 15, 2015
Sending an OP_RETURN Bitcoin Transaction with Go using Chain's Bitcoin API
View main.go
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"io/ioutil"
"log"
"net/http"
@ryandotsmith
ryandotsmith / agg.sql
Created Jan 23, 2013
Postgres array concatenation aggregate function.
View agg.sql
CREATE AGGREGATE array_accum (anyarray)
(
sfunc = array_cat,
stype = anyarray,
initcond = '{}'
);
@ryandotsmith
ryandotsmith / op_return.rb
Created Feb 9, 2015
Chain.com OP_RETRURN Transaction - Create Bitcoin OP_RETURN Transactions in Ruby
View op_return.rb
require 'bitcoin'
require 'chain'
Chain.block_chain = 'testnet3'
Bitcoin.network = :testnet3
include Bitcoin::Builder
key = Bitcoin::Key.from_base58("cVVBKRBMoPLJSSMW7cM3hji7VmXz1zJWX3DypcjPcWpRBMEu2xF7")
builder = Bitcoin::Builder::TxBuilder.new
View a-backbone-js-demo-app-sinatra-backend.md

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

View event_buffering.md

Event Buffering

Eventually platforms outgrow the single-source-tree model and become distributed systems. A common pattern in these distributed systems is distributed composition via event buffering. Here we motivate and describe this event buffering pattern.

The Problem

View worker-pattern.md

The Worker Pattern

Contents

  • Introduction
  • Definition
  • Examples
  • Links

Introduction

@ryandotsmith
ryandotsmith / hack-reactor.md
Last active Sep 27, 2018
Hack Reactor Talk
View hack-reactor.md

Tales From a Heroku User

Here are some things I have learned along the way.

Last Updated: 2013-02-08

Original Audience: Hack Reactor

About

@ryandotsmith
ryandotsmith / policy.json
Created Sep 20, 2013
AWS IAM Read Only
View policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"autoscaling:Describe*",
"cloudformation:DescribeStacks",
"cloudformation:DescribeStackEvents",
"cloudformation:DescribeStackResources",
"cloudformation:GetTemplate",
View process-partitioning.md

Process Partitioning

The Problem

When working with large, high volume, low latency systems, it is often the case that processing data sequentially becomes detrimental to the system's health. If we only allow 1 process to work on our data we run into several challenges:

  • Our process may fall behind resulting in a situation which it is impossible for our process to catch up.
  • Our singleton process could crash and leave our system in a degraded state.
  • The average latency of data processing could be dramatically affected by outlying cases.