This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1HPjUzjUSqz7u8zTiG1oHM4y5mWkgku9Qz https://explorer.blockstack.org/address/1HPjUzjUSqz7u8zTiG1oHM4y5mWkgku9Qz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actions that can be successfully applied | |
harvest = ------------------------------------------ | |
actions that neeed to be applied | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Selecting loans based on modulus | |
SELECT * | |
FROM loans | |
WHERE id % <modulus> = <bucket>; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |