Skip to content

Instantly share code, notes, and snippets.

View mindjuice's full-sized avatar

Ken Carpenter mindjuice

View GitHub Profile
@mindjuice
mindjuice / gist:b371be31a1b9a28d6b75ca65ae7b1862
Created October 14, 2019 02:33
Siacoin Price from Bittrex
set initialInvestmentUsd to 142000
set scOwned to 1000000
set jsonBtcSc to do shell script "curl https://bittrex.com/api/v1.1/public/getticker?market=btc-sc"
set valueBtcSc to do shell script "sed s/[a-zA-Z:{}]//g <<< " & jsonBtcSc
set valueBtcSc to do shell script "sed s/.*,//g <<< " & valueBtcSc
set jsonUsdtBtc to do shell script "curl https://bittrex.com/api/v1.1/public/getticker?market=usdt-btc"
set valueUsdtBtc to do shell script "sed s/[a-zA-Z:{}]//g <<< " & jsonUsdtBtc
set valueUsdtBtc to do shell script "sed s/.*,//g <<< " & valueUsdtBtc
# set numberBtcSc to replace_chars(valueBtcSc, ".", ",") as number
@mindjuice
mindjuice / authActions.js
Last active May 19, 2016 20:54
Simple HTTP requests code using promises. Integrates nicely with Redux actions when using redux-thunk middleware. `httpRequests.js` has the `get`, `put`, `post` and `del` functions and `authActions.js` gives examples of calling `post()` and `get()`.
import { get, post } from '../../../utils/httpRequests';
export const AUTH_LOGIN = 'AUTH_LOGIN';
export const AUTH_LOGOUT = 'AUTH_LOGOUT';
export const login = (email, password) => {
const params = { username: email, password };
return dispatch => post('/api/login', AUTH_LOGIN, params, dispatch);
};