Skip to content

Instantly share code, notes, and snippets.

@potomak
potomak / example.go
Created April 11, 2018 14:22
Go interface example
// Run at https://play.golang.org/p/gYCGtWOHGci
package main
import (
"fmt"
)
// Define an interface
type Foo interface {
@potomak
potomak / Rinkeby.md
Created August 11, 2017 21:40 — forked from learner-long-life/Rinkeby.md
How to get on Rinkeby Testnet in less than 10 minutes

How to get on Rinkeby Testnet in less than 10 minutes

Following instructions from the excellent https://www.rinkeby.io/

Synchronizing a Full Node

A full node lets you access all state. There is a light node (state-on-demand) and wallet-only (no state) instructions as well,

0x95BcA9Cf2C4984978D658bDc1aA22cf447Cdb33f
main :: IO ()
main = scotty 8080 $ do
get "/hello" $ do
let content = "Hello world!"
respondTo $ do
formatJson $
json $ object ["content" .= content]
formatText $
text content
format "application/vnd.chess-pgn" $ do
@potomak
potomak / airbrake_fetcher.rb
Last active June 12, 2016 17:21
Collect and show Airbrake errors metrics with Ruby
require 'json'
require 'open-uri'
class AirbrakeFetcher
BASE_URL = 'https://airbrake.io'
DEFAULT_LIMIT = 100
def initialize(api_key, project_id)
@api_key = api_key
@project_id = project_id
@potomak
potomak / README.md
Last active March 20, 2016 15:38
Profiling a Haskell executable memory usage

Profiling a Haskell executable memory usage

To generate a heap profile from your program:

  1. Compile the program for profiling.
  2. Run it with one of the heap profiling options (eg. -h for a basic producer profile). This generates the file prog.hp.
  3. Run hp2ps to produce a Postscript file, prog.ps.

Notes about the compilation for profiling

@potomak
potomak / 01.markdown
Last active June 2, 2021 02:35
gist-txt @ Manhattan.js
state
next prev
02
index

What is gist-txt?

gist-txt is an adventure game engine

@potomak
potomak / hello-world.txt
Last active January 29, 2017 22:30
Hello World!
Hello World!Foo
Bar
@potomak
potomak / index.markdown
Created April 1, 2015 04:35
The forest
@potomak
potomak / FacebookL.jpg
Last active November 15, 2017 11:01
The daily routine
FacebookL.jpg