Skip to content

Instantly share code, notes, and snippets.

View ashander's full-sized avatar

Jaime Ashander ashander

View GitHub Profile
@ashander
ashander / dropbox.json
Created June 24, 2019 17:11
A scoop manifest for installing dbxcli dropbox command line client for windows
{
"version": "v3.0.0",
"license": "Apache-2.0",
"extract_dir": "",
"url": "https://github.com/dropbox/dbxcli/releases/download/v3.0.0/dbxcli-windows-amd64.exe",
"depends": "",
"homepage": "https://github.com/dropbox/dbxcli/",
"hash": "D21151C596271DFE75C55DC915C179CCF136B50BFED206E95855068A17DBE875",
"bin": [["dbxcli-windows-amd64.exe", "dropbox"]]
}
@ashander
ashander / spartina.json
Last active October 15, 2018 17:25
Information sharing between institutions involved in the project to eradicate invasive _Spartina_ in the SF Bay region, copied by eye from Lubell, Jasny, Hastings 2018 _Conservation Letters_
{
"nodes": [
{"id": "Marin County", "group": 2},
{"id": "USFWS San Pablo WFR", "group": 4},
{"id": "City of San Mateo", "group": 1},
{"id": "City of Alameda", "group": 1},
{"id": "East Bay Regional Parks", "group": 2},
{"id": "Invasive Spartina Project", "group": 5},
{"id": "USFWS", "group": 4},
{"id": "USFWS Don Edwards WFR Complex", "group": 4},
@ashander
ashander / badpop.rds
Last active November 22, 2017 04:29
issue with raster via landsim
@ashander
ashander / google-scholar.html
Last active September 25, 2017 21:12
Google scholar advanced bookmarklet
<!-- copy and paste all lines starting with javascript: below into a new bookmark. you will need to click it twice to
get to GS advanced.
Uses logic from from https://stackoverflow.com/questions/2267718/loading-page-and-executing-js-on-it-from-js-bookmarklet -->
javascript:
var url = this.document.location.href;
if(!url.includes("https://scholar.google.com/")) {
this.document.location.href = "https://scholar.google.com/";
} else {
if (document.readyState === "complete") {
var hp = document.getElementById('gs_hp_drw_adv');
@ashander
ashander / comet-and-conda-errors.md
Last active June 6, 2023 01:12
Error attempting to use numpy via conda on SDSC's Comet resource --- due to default number of threads requested by OpenMP

The error below can be avoided by export OMP_NUM_THREADS=2 (or possibly a higher number). To see this run:

env OMP_NUM_THREADS=2 python -c 'import numpy'

environment

system

@ashander
ashander / make_and_delete_tree.sh
Last active March 21, 2017 21:42
what does `unlink` do in R?
mkdir -p tmp tmp/c
touch tmp/a tmp/b tmp/c/d
$ tree tmp
# tmp
# ├── a
# ├── b
# └── c
# └── d
cd tmp
strace -o ../strace.log Rscript -e 'unlink(c("a", "b", "c"), recursive=TRUE)'
@ashander
ashander / README.md
Last active May 3, 2017 17:35
Follow tweets and retweets (etc) on streaming API
@ashander
ashander / Makefile
Last active January 27, 2017 07:41
Equity distribution (from Survey of Consumer Finances)
README.md: README.Rmd
Rscript -e 'rmarkdown::render("README.Rmd")'
cp README_files/figure-markdown_strict/equity-vigesimals-1.png equity-vigesimals-1.png
cp README_files/figure-markdown_strict/equity-deciles-by-age-1.png equity-deciles-by-age-1.png
rscfp2013.dta: scfp2013s.zip
unzip scfp2013s.zip
scfp2013s.zip:
wget https://www.federalreserve.gov/econresdata/scf/files/scfp2013s.zip
@ashander
ashander / README.md
Last active January 16, 2017 21:39
SNAP foods typically purchased
@ashander
ashander / msprime_covering.py
Last active October 31, 2016 23:08
Msprime records $\sum_i (l_i - r_i)$ will _not_ sum to `n-1` for `n` samples (unless there is no recombination)
import msprime
pop = __import__('random').randint(2, 20000)
sum = 0
with open('example.tsv', 'w') as f:
msprime.simulate(pop, recombination_rate = 10).write_records(f)
with open('example.tsv', 'r') as f:
f.readline()
l = f.readlines()
for line in l:
vec = line.split('\t')