Skip to content

Instantly share code, notes, and snippets.

View alexcusack's full-sized avatar

Alex Cusack alexcusack

  • Coinbase
  • San Francisco
View GitHub Profile
# echo is like puts for bash (bash is the program running in your terminal)
echo "Loading ~/.bash_profile"
# $VARIABLE will render before the rest of the command is executed
echo "Logged in as $USER at $(hostname)"
# Load RVM into a shell session *as a function*
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
# Path for RVM
test -d "$HOME/.rvm/bin" && PATH="$PATH:$HOME/.rvm/bin"
Verifying my Blockstack ID is secured with the address 1HPjUzjUSqz7u8zTiG1oHM4y5mWkgku9Qz https://explorer.blockstack.org/address/1HPjUzjUSqz7u8zTiG1oHM4y5mWkgku9Qz
actions that can be successfully applied
harvest = ------------------------------------------
actions that neeed to be applied
/**
* A not-exactly-how-we-did-this-but-something-similar-implementation
* Enqueues a payment-processor execution for 0 - (buckets - 1)
* @param {Int} buckets: the number of Payment Processor executions to enqueue
* @param {Object} queue: Amazon SQS queue
* @returns {Promise(<Array>)} Array of queue receipts
*/
import {range} from 'lodash';
import * as P from 'bluebird';
// hash a string to a 64bit Int
import { createHash } from 'crypto'
function stringToInt(lockName) {
const buf = createHash('sha256').update(lockName).digest()
return [buf.readInt32LE(0), buf.readInt32LE(4)]
}
// implementation credit: https://github.com/binded/advisory-lock
-- Selecting loans based on modulus
SELECT *
FROM loans
WHERE id % <modulus> = <bucket>;
#!/usr/bin/env python3
SERVER_IP_ADDRESS='10.146.115.109'
from two1.commands.config import Config
from two1.lib.wallet import Wallet
from two1.lib.bitrequests import BitTransferRequests
username = Config().username
wallet = Wallet()
requests = BitTransferRequests(wallet, username)