Skip to content

Instantly share code, notes, and snippets.

View weissjeffm's full-sized avatar

Jeff Weiss weissjeffm

View GitHub Profile
@weissjeffm
weissjeffm / rationale.org
Last active December 7, 2021 16:44
bitcoin investment rationale

Why is bitcoin valuable?

Summary

Bitcoin is valuable because it is scarce in a way that humans have never experienced before, it’s easy to secure and transfer, highly divisible, fungible, programmable, and impossible to counterfeit.

Objective uses

Spend your money anytime without penalty

In today’s dollar world, you cannot spend your money anytime. Sure, you can spend it today or tomorrow. But what about in 20 years? You can’t do that, because in 20 years, more than half of your money will

@weissjeffm
weissjeffm / mysession.js
Last active January 5, 2021 16:50
Bitcoin private key sharing, with shamir's secret splitting using secrets.js and bitaddress.org
//init - not sure if necessary
secrets.setRNG()
secrets.init(3)
//encode
secrets.share(
ninja.publicKey.getHexFromByteArray(
Bitcoin.Base58.decode("5HyLghwYt9hGVZVSuSJwpj2tgfUqWqdVd2jy7ZC45m55b8zAKeN")),
4, 2)
//where "5H..." is the private key, 4 is the number of shares, 2 is the threshhold
@weissjeffm
weissjeffm / handler.clj
Created December 17, 2010 16:32
An error handler for Clojure
(ns com.redhat.qe.handler
(:import [javax.naming NamingException]))
(def *handlers* [])
(def *error* nil)
(defn- e-to-map [e]
{:msg (.getMessage e) :type (class e) :exception e})
(defn- wrapped? [e]
@weissjeffm
weissjeffm / branches.org
Created October 30, 2019 15:57
Tradeoffs of different branching strategies

Summary pro/con of multiple integration branch vs one

Summary

More branches means less time in a broken state, but more time testing independent versions

More branches: Pro

You can code and test independently.

That means, unrelated changes from someone else’s branch aren’t going to break yours.

More branches: Con

@weissjeffm
weissjeffm / match.clj
Created June 10, 2019 16:56
match fn
(defn match [pattern input-string]
(loop [[[op op-arg alt] :as pattern] pattern [chr :as input-string] input-string]
(if op
(let [res (case op
:req (= op-arg chr)
:opt (if (= op-arg chr)
true
:next)
:alt (or (= op-arg chr)
(= alt chr)))]
#+BEGIN_SRC restclient
POST :base-url/reports/schedules/create
Content-Type: application/json
Accept: application/json
x-lg-session: :session-token
{"params": {"name": "jeff-vendor",
"final": 1655609567371,
"recipients": [{"type": "user",
"user-id": "5C!N<nPM6jCLbK]OzguatPN$Z"}],
@weissjeffm
weissjeffm / __init__.py
Created January 22, 2014 17:30
Form impl
"""
cfme.web_ui
-----------
The :py:mod:`cfme.web_ui` module provides a number of objects to help with
managing certain elements in the CFME UI. Specifically there two categories of
objects, organizational and elemental.
* **Organizational**
@weissjeffm
weissjeffm / anonymous-gist.py
Created January 21, 2014 16:30
contextmgr example
class Provider(object):
def __init__(self, x=None):
self.x = x
myprov = Provider(x=0)
with update(myprov) as updated:
updated.x = 1
@weissjeffm
weissjeffm / anonymous-gist.
Created January 2, 2014 20:22
highlight fail
(cfme)[jweiss@localhost cfme_tests]$ py.test -k login
============================= test session starts ==============================
platform linux2 -- Python 2.7.5 -- pytest-2.5.1
collected 243 items
cfme/tests/test_login.py ..
tests/test_phantom_login.py F
tests/ui/test_login.py F
=================================== FAILURES ===================================
@weissjeffm
weissjeffm / anonymous-gist.
Created January 2, 2014 19:24
legacy sel fail
============================= test session starts ==============================
platform linux2 -- Python 2.7.5 -- pytest-2.5.1
collected 243 items
cfme/tests/test_login.py ..
tests/test_phantom_login.py E
tests/ui/test_login.py E
==================================== ERRORS ====================================
_____________________ ERROR at setup of test_phantom_login _____________________