Skip to content

Instantly share code, notes, and snippets.

View fasiha's full-sized avatar
💭
🐦‍🔥

Ahmed Fasih fasiha

💭
🐦‍🔥
View GitHub Profile
@fasiha
fasiha / bivariateMonteCarloPosterior.py
Created August 23, 2021 06:27
Verifying that Monte Carlo posterior moments on scalar model parameters extend to the bivariate (and multivariate) parameter case. Obvious in retrospect but I am VERY VERY BAD at math.
"""
We know how to use Monte Carlo to find moments of the posterior
```
P(parameter | data) ∝ P(data | parameter) * P(parameter)
```
That is, `posterior ∝ likelihood * prior`.
We generate parameter draws, and for each draw, assign a weight equal to
`P(data | parameters)`, since we have data. Then the weighted mean, weighted
variance, etc. give us the moments of the posterior.
@fasiha
fasiha / transcript.md
Created July 4, 2021 01:50
Unofficial lightly-edited transcript of BradyDale@twitter, lanalana@twitter, and virtuallylaw@twitter on the podcast episode, "💡💬 What actually are scams in the world of cryptocurrency?" https://mobile.twitter.com/lanalana/status/1407835248478625794 and https://podcasts.apple.com/us/podcast/spacecasts/id1568772123?i=1000526662687

Okay, hey, how's it going? My name is Brady Dale, and I am here with light bulb talks the podcast that I do every Tuesday and thursday night here on twitter spaces and then later shows up on the Space Cast network. We're here tonight to talk about scams—and scams and crypto.

Scams is one of those words that gets thrown around in crypto so much that it sort of stopped having any kind of real meaning, because it's—folks just say it when there's a project, they don't like, they call it a scam. And I think what they mean is "I don't think this thing is gonna work out" and that's fine, maybe it won't. But it doesn't mean it's a scam, it doesn't mean that it was done in bad faith, but as one of our guests tonight, Lana Swartz, a professor in Virginia and who studies communications and and who has studied crypto in particular and money more broadly, and how money is kind of a social network, wrote a book about it that I that I wrote about last year called "New Money: How many became Social". She does a good job of

@fasiha
fasiha / README.md
Created June 24, 2021 21:23
Alphabetical list of named trans-Neptunian objects' names

In case you need an ASCII-alphabetical list of trans-Neptunian objects with non-numeric names, perhaps to use as the naming scheme for sprints?, please enjoy—

  • Albion
  • Alicanto
  • Altjira
  • Arawn
  • Arrokoth
  • Borasisi
  • Ceto
  • Chaos
@fasiha
fasiha / README.md
Last active July 6, 2022 09:10
Breathing planet: 2020 NDVI edition

Download NDVI from NASA and make a mp4 animation

# Download a bunch of files. I manually generated this list of URLs from https://neo.sci.gsfc.nasa.gov/view.php?datasetId=MOD_NDVI_M&year=2020
curl -L -o 2020-01.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1784251&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 2020-02.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1785227&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 2020-03.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1786238&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 2020-04.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1787159&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 2020-05.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1794756&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 2020-06.png https://neo.sci.gsfc.nasa.gov/servlet/RenderData?si=1795819&cs=rgb&format=PNG&width=3600&height=1800
curl -L -o 202
@fasiha
fasiha / README.md
Last active October 24, 2022 12:17
iTerm2, Karabiner Elements, and Hammerspoon for new Mac

Introduction

Setup for

Setup

First, install all three tools above. (Or just iTerm2 if you don't care about keyboard speedups; or just Karabiner Elements & Hammerspoon if you don't care about iTerm2).

Then clone this repository to your local computer: run this in Terminal:

@fasiha
fasiha / README.md
Last active February 12, 2021 21:19
One of my favorite sections of Aaron Brown's "Financial risk management for dummies", chapter 4, on the three ways to look at markets

Looking at Financial Markets

Academics who study finance but don’t actually work in the field have developed two main views of financial markets:

  • Information aggregation: Economists tend to treat financial markets as mechanisms for evaluating information and using it to set prices, which in turn regulate economic activity.
  • Random walk: Finance professors tend to treat markets as random walks. In a random walk, future price movements don’t depend on past movements. The metaphor is a drunk person taking each step in a randomly chosen direction, as opposed to a sober person whose steps can be predicted by the path she’s on. Of course, these finance professors don’t deny that markets process information and set prices, but if today’s price incorporates everything known today, then the move to tomorrow’s price must be unpredictable, or random.

A third view of financial markets is seldom taught in universities, at least not in economics departments and business schools. This third view holds that financial

Antirez, creator of Redis, excellent C programmer and API designer, tweeted this:

https://twitter.com/antirez/status/1282967596350881792 (the thread goes both up and down from this link, it'd be helpful to scroll up then read)

He says (paraphrasing) that

(0) while programming is many things to many people,

(1) to him, part of programming is being able to implement a bubble sort or selection sort (slow, quadratic algorithms that are rarely seen outside beginner courses) under pressure—in an interview or on the job,

@fasiha
fasiha / combinatorics.ts
Last active January 19, 2025 19:06
JavaScript/TypeScript basic combinatorics generators/iterators—because I always forget how these work. UNLICENSE, in the public domain.
/**
* Simple Cartesian product generator.
*
* Given an N-long array of numbers `lenarr`, where each element representing how many choices are available for that
* position, generate all N-long arrays where the `idx`th element runs from 0 to `lenarr[index]`.
*
* ```ts
* for (const x of numericCartesianProduct([2, 3])) { console.log(x); }
* ```
* generates:
@fasiha
fasiha / README.md
Last active September 27, 2020 01:33
Express.js and PouchDB-Server: demo for multi-database Express-controlled "auth" with URL-rewriting https://stackoverflow.com/q/64056888

Introduction via Stack Overflow question & answer

https://stackoverflow.com/q/64056888

Setup

git clone THIS_GIST_URL pouch-demo
cd pouch-demo
mkdir databases
npm install
node server.js
@fasiha
fasiha / 1.txt
Created September 6, 2020 04:34
Ebieki 🦐🚉 path through Wanikani vocabulary https://github.com/fasiha/ebieki
## Path through radicals for vocabulary: one kanji/radical per lesson
一: Already known 一
日: Already known 日
十: Already known 十
目: Already known 目
田: Already known 田
中: Already known 中
口: Already known 口
人: Already known 人
二: Already known 二