Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
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
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
arnavs / covid.jl
Last active Mar 31, 2020
COVID Analysis
View covid.jl
# data source is: https://pomber.github.io/covid19/timeseries.json
# 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)
View git_create_orphan.sh
git checkout --orphan docs
git rm -rf .
git commit --allow-empty -a -m "Initial Commit"
git push origin docs
@arnavs
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
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.
include("apikey.jl")
response = get("https://wordsapiv1.p.mashape.com/words/?partOfSpeech=noun&random=true"; headers=Dict("X-Mashape-Key" => "$key"))
word = JSON.parse(readstring(response))["word"]
startup = rand(["Uber", "AirBnB", "Tinder", "Oracle"])
You can’t perform that action at this time.