Skip to content

Instantly share code, notes, and snippets.

SEC. 1071. SMALL BUSINESS DATA COLLECTION.
(a) In General.--The Equal Credit Opportunity Act (15 U.S.C. 1691 et
seq.) is amended by inserting after section 704A the following:
``SEC. 704B. <<NOTE: 15 USC 1691o-2.>> SMALL BUSINESS LOAN DATA
COLLECTION.
``(a) Purpose.--The purpose of this section is to facilitate
enforcement of fair lending laws and enable communities, governmental
entities, and creditors to identify business and community development
@pbostrom
pbostrom / blk.log
Last active March 7, 2019 22:21
Block 2963292
Mar 7 21:58:44 ip-10-255-235-41 plasmachain[17287]: I[7036-03-07|21:58:44.068] Timed out module=consensus dur=178.303011ms height=2963292 round=0 step=RoundStepNewHeight
Mar 7 21:58:44 ip-10-255-235-41 plasmachain[17287]: I[7036-03-07|21:58:44.068] enterNewRound(2963292/0). Current: 2963292/0/RoundStepNewHeight module=consensus height=2963292 round=0
Mar 7 21:58:44 ip-10-255-235-41 plasmachain[17287]: I[7036-03-07|21:58:44.068] enterPropose(2963292/0). Current: 2963292/0/RoundStepNewRound module=consensus height=2963292 round=0
Mar 7 21:58:44 ip-10-255-235-41 plasmachain[17287]: I[7036-03-07|21:58:44.068] enterPropose: Not our turn to propose module=consensus height=2963292 round=0 proposer=150F80F0FECADF51D2E918F9B1F25310FCD88964 privValidator="&{PrivateKey:0xc0025150e0 hsmConfig:0xc004537180 LastHeight:2963291 LastRound:1 LastStep:3 LastSignature:[30 16 204 72 46 0 50 233 38 39 85 243 250 114 228 199 82 96 194 226 120 231 8 244 167 218 241 75 114 11 113 15 78 16
@pbostrom
pbostrom / missed.sh
Last active February 22, 2019 02:53
block_age() {
bt=$(date -d "$1" +%s)
now=$(date +%s)
echo $(( $now - $bt ))
}
status=$(curl -s http://localhost:46657/status)
addr=$(echo $status | jq -r ".result.validator_info.address")
lbh=$(echo $status | jq -r ".result.sync_info.latest_block_height")
@pbostrom
pbostrom / README.md
Last active February 12, 2019 20:15
Livepeer
Livepeer node

The only things needed to run a Livepeer broadcasting node is the livepeer binary and an Ethereum keystore with passphrase. Copy the keystore to ~/.lpData/keystore and start the node with:

$ livepeer -ethPassword "passphrase" -ethUrl ws://<mainnet RPC server>:8546 -rtmpAddr 0.0.0.0:1935 -httpAddr 0.0.0.0:8935

This will create an RTMP endpoint on port 1935, which will accept connections from live video streams. Additionally, an HLS endpoint on port 8935 is used for streaming transcoded video to connecting players. You will need to deposit funds into your Livepeer account to pay transcoding fees. Use the Livepeer explorer and MetaMask to make a deposit using the same Ethereum account as above: https://explorer.livepeer.org/accounts//broadcasting. Once you have some funds you will need to configure the broadcasting node using the livepeer_cli command to set your maximum broadcasting fees and your desired tran

Jul 26 14:02:01 ip-10-255-237-138 gaiad[12779]: I[07-26|14:02:01.352] HTTPRestRPC module=rpc-server method=/block args="[<*int64 Value>]" returns="[<*core_types.ResultBlock Value> <error Value>]"
Jul 26 14:02:01 ip-10-255-237-138 gaiad[12779]: I[07-26|14:02:01.352] Served RPC HTTP response module=rpc-server method=GET url="/block?height=0" status=200 duration=0 remoteAddr=127.0.0.1:57904
Jul 26 14:02:23 ip-10-255-237-138 gaiad[12779]: I[07-26|14:02:23.170] Ensure peers module=p2p numOutPeers=0 numInPeers=0 numDialing=0 numToDial=10
Jul 26 14:02:23 ip-10-255-237-138 gaiad[12779]: I[07-26|14:02:23.170] No addresses to dial nor connected peers. Falling back to seeds module=p2p
Jul 26 14:02:23 ip-10-255-237-138 gaiad[12779]: I[07-26|14:02:23.173] Dialing peer module=p2p address=5922bf29b48a18c2300b85cc53f424fce23927ab@67.207.73.206:26656
Jul 26 14:02:23 ip-10-255-237-138 gaiad[12779]: E[07-26|14:02
@pbostrom
pbostrom / cljs-npm.md
Last active March 8, 2024 07:53
Loading third-party npm modules in ClojureScript

Loading third-party npm modules in ClojureScript

This example shows how to load the re-resizable npm module which provides a resizable React component. Requires the lein-npm plugin.

  1. Add the npm module to the :npm :dependencies section of project.clj:
 :npm {:package {:scripts {:build "webpack -p"}}
       :dependencies [[react "16.4.0"]
                      [react-dom "16.4.0"]
                      ["@cljs-oss/module-deps" "1.1.1"]
@pbostrom
pbostrom / cloudwatch_health.sh
Last active July 17, 2018 19:25
Monitor your gaiad validator
#!/bin/bash
aws cloudwatch put-metric-data --metric-name UnhealthyValidator\
--value $1 --namespace "Cosmos" --region us-east-1

Keybase proof

I hereby claim:

  • I am pbostrom on github.
  • I am pbostrom (https://keybase.io/pbostrom) on keybase.
  • I have a public key ASAINjnms6Tr5cD0SeBjfDzEgBzZjvyM6A1R9rJahOC5qwo

To claim this, I am signing this object:

1. with-redefs is not thread safe. As explained in the doc string, the changes will be visible in all threads. What's not obvious though is that the act of restoring the original values of the Vars will also be visible across all threads.

clojure.core/with-redefs
([bindings & body])
Macro
Added in 1.3
  binding => var-symbol temp-value-expr

  Temporarily redefines Vars while executing the body.  The
  temp-value-exprs will be evaluated and each resulting value will
```clojure
(defn print-it []
(println "don't print this"))
(defn dont-print [x]
(with-redefs [print-it (constantly nil)]
(print-it)))
(defn -main []
(doall (pmap dont-print (range 1000)))