Skip to content

Instantly share code, notes, and snippets.

View cayblood's full-sized avatar

Carl Youngblood cayblood

View GitHub Profile
@cayblood
cayblood / gist:1440190
Created December 6, 2011 21:54
example of using the ruby sequel gem to access a sqlite3 database on jruby
#############################################################################
# to use this in jruby:
#
# jgem install sequel
# jgem install jdbc-sqlite3
#
# for more info on the sequel library, go to http://sequel.rubyforge.org/
#############################################################################
require 'rubygems'
@cayblood
cayblood / tezzigator.sh
Last active May 19, 2018 22:47
Script to automatically execute the steps in Tezzigator baking tutorial https://medium.com/@Tezzigator/permanent-tezos-sandboxing-509368945c4a on Ubuntu 16.04 LTS
#!/bin/bash
git clone -b zeronet https://gitlab.com/tezos/tezos.git
cd tezos
curl https://gist.githubusercontent.com/cayblood/329d24a099555e9a436f55a1cb8eb541/raw/c120c025465edfc8fa6bf4bbdbbef1ac79181da6/dictator-key.patch | patch -p1
sudo add-apt-repository ppa:avsm/ppa
sudo apt-get update
sudo apt-get install ocaml-nox opam
opam init
opam update
diff --git a/src/proto_alpha/lib_protocol/src/constants_repr.ml b/src/proto_alpha/lib_protocol/src/constants_repr.ml
index edf3007..c34f23d 100644
--- a/src/proto_alpha/lib_protocol/src/constants_repr.ml
+++ b/src/proto_alpha/lib_protocol/src/constants_repr.ml
@@ -81,7 +81,7 @@ let default = {
Int64.(sub (shift_left 1L 56) 1L) ;
dictator_pubkey =
Signature.Public_key.of_b58check_exn
- "edpkugeDwmwuwyyD3Q5enapgEYDxZLtEUFFSrvVwXASQMVEqsvTqWu" ;
+ "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2" ;
{
"bootstrap_accounts": [
["edpkuBknW28nW72KG6RoHtYW7p12T6GKc7nAbwYX5m8Wd9sDVC9yav", "4000000000000"],
["edpktzNbDAUjUk697W7gYg2CRuBQjyPxbEg8dLccYYwKSKvkPvjtV9", "4000000000000"],
["edpkuTXkJDGcFd5nh6VvMz8phXxU3Bi7h6hqgywNFi1vZTfQNnS1RV", "4000000000000"],
["edpkuFrRoDSEbJYgxRtLx2ps82UdaYc1WwfS9sE11yhauZt5DgCHbU", "4000000000000"],
["edpkv8EUUH68jmo3f7Um5PezmfGrRF24gnfLpH3sVNwJnV5bVCxL2n", "4000000000000"]
],
"dictator_pubkey": "edpkuSLWfVU1Vq7Jg9FucPyKmma6otcMHac9zG4oU1KMHSTBpJuGQ2"
}
python -m SimpleHTTPServer 8000
@cayblood
cayblood / 0_reuse_code.js
Created September 17, 2017 15:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cayblood
cayblood / my-element.html
Created November 13, 2014 23:17
how to pass object attributes to a custom element
<!-- 1st method: trying to pass attribute as JSON -->
<my-element options='{"name": "Joe Blow"}'></my-element>
<!-- 2nd method: trying to pass a global object -->
<script>
window.obj = {name: "Joe Blow"};
</script>
<my-element options="{{window.obj}}"></my-element>
carl@Carls-MacBook-Pro ~/Source/work/divvy/candidate-homework/DavidCox/divvy [git:master] ruby-2.1.5
∴ cat README.md
divvy
This app enables fast searching of the baby name dataset found at `http://catalog.data.gov/dataset/2012-baby-names-ac0a2`
At startup, the app read the dataset from its source and loads it into a in-memory sqlite database. A single endpoint is then exposed to enable querying for sets of names that match a given string. A web interface is provided to aid in that querying.
Must have node and npm installed, with bower installed globally.
iex(1)> alias Decimal, as: D
Decimal
iex(2)> D.set_context(%D.Context{D.get_context | precision: 2})
:ok
iex(3)> D.new("15.620000")
#Decimal<15.620000>
iex(4)> D.round(D.new("15.620000"), 2)
#Decimal<16>
defmodule Juno.Factory do
use ExMachina.Ecto, repo: Juno.Repo
# import GoodTimes
# import GoodTimes.Convert
alias Juno.Transaction
alias Juno.VirtualCard
def transaction_factory do
%Transaction {
description: "Description",