Skip to content

Instantly share code, notes, and snippets.

if it's not free, it's not worth paying for

Arnav Sood arnavs

if it's not free, it's not worth paying for
View GitHub Profile
arnavs /
Created Apr 13, 2021
update coinbase pro DCA for Python 3
# secrets
API_KEY = "something"
API_PASS = "something else"
API_SECRET = "also something else"
# boilerplate
import requests
import json, hmac, hashlib, time, requests, base64
from requests.auth import AuthBase
View MTK_262_tests.jl
using ModelingToolkit, Test, SparseArrays
@variables a b c
# Auxiliary Functions and Constants
get_sparsity_pattern(h::Array{Expression}) = sparse(Int64.(map(~, h .=== ModelingToolkit.Constant(0))))
get_sparsity_pattern(h::SparseMatrixCSC{Expression,Int64}) = sparse(Int64.(map(~, h .=== ModelingToolkit.Constant(0))))
get_sparsity_pattern(h::SparseVector{Expression,Int64}) = sparse(Int64.(map(~, h .=== ModelingToolkit.Constant(0))))
input = [1, 2, 3]
arnavs / covid.jl
Last active Mar 31, 2020
COVID Analysis
View covid.jl
# data source is:
# data is updated thrice daily from Johns Hopkins numbers
using Pkg
pkg"activate .."
using JSON, Statistics, Plots, Dates, LsqFit, TimeSeries
data = JSON.parsefile("../data/timeseries_03_31_20.json");
# Aggregate statistics
function unpack_country(country)
git checkout --orphan docs
git rm -rf .
git commit --allow-empty -a -m "Initial Commit"
git push origin docs
arnavs / search.jl
Last active Jul 20, 2017
A script to help with debate research.
View search.jl
# A script to take one list of words (topic-related), and one list of words (philosophy-related), and get searches for all the related words.
# Dependencies.
using Requests
using JSON
apikey = "919db630ecc84118a1acc2914dc7bd55"
# Words.
topicWords = ["health care", "single payer", "public option"]
philWords = ["genealogy", "phenomenology", "Foucault"]
arnavs / business-side.jl
Created Jul 16, 2017
Some code to handle the business side of your startup.
View business-side.jl
using Requests
using JSON
# Import API key.
response = get(""; headers=Dict("X-Mashape-Key" => "$key"))
word = JSON.parse(readstring(response))["word"]
startup = rand(["Uber", "AirBnB", "Tinder", "Oracle"])