Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🧘‍♂️

Ahmed Fasih fasiha

💭
🧘‍♂️
View GitHub Profile
@fasiha
fasiha / README.md
Last active Feb 27, 2021
iTerm2, Karabiner Elements, and Hammerspoon for new Mac
View README.md

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 Feb 12, 2021
One of my favorite sections of Aaron Brown's "Financial risk management for dummies", chapter 4, on the three ways to look at markets
View README.md

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

View post.md

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
Created Oct 30, 2020
JavaScript/TypeScript basic combinatorics generators/iterators—because I always forget how these work
View combinatorics.ts
function* range(start: number, end: number) {
for (; start <= end; ++start) { yield start; }
}
function last<T>(arr: T[]) { return arr[arr.length - 1]; }
export function* numericCombinations(n: number, r: number, loc: number[] = []): IterableIterator<number[]> {
const idx = loc.length;
if (idx === r) {
yield loc;
return;
}
@fasiha
fasiha / README.md
Last active Sep 27, 2020
Express.js and PouchDB-Server: demo for multi-database Express-controlled "auth" with URL-rewriting https://stackoverflow.com/q/64056888
View README.md

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 Sep 6, 2020
Ebieki 🦐🚉 path through Wanikani vocabulary https://github.com/fasiha/ebieki
View 1.txt
## 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 二
View rename-photos.sh
for f in $@; do
d=`exiftool -dateFormat "%Y-%m-%d %H.%M.%S" -CreateDate "$f" | tail -n1 | cut -d: -f2- | sed 's/^ //'`;
b=$(basename "$f");
final="$d-$b";
echo $final;
mv "$f" "$final"
done
@fasiha
fasiha / example.md
Created May 19, 2020
Curtiz NLP Annotation
View example.md
  • @ もっとかっこう使つかったほうがいいよ
    • Particles
    • Conjugated phrases
      • 使った | 使つかう + た
    • Vocab
      • もっと | 「もっと」| ① (some) more/even more/longer/further
      • 格好 | 格好・恰好「かっこう・かっこ・カッコ」| ① shape/form/figure/posture/pose ② appearance ③ state/situation ④ suitable/fit/reasonable ⑤ about
@fasiha
fasiha / onyomi-frequency.txt
Created May 7, 2020
Frequencies of Japanese onyomi (on'yomi 音読み) in KANJIDIC2 (https://www.edrdg.org/wiki/index.php/KANJIDIC_Project). Generated via `grep ja_on kanjidic2.xml | grep '<reading' | sed 's:<[^>]*>::g' | sort | uniq -c| sort -r`: the higher an onyomi appears on this list, the more kanji it's associated with. Potentially helpful e.g., when creating mnemo…
View onyomi-frequency.txt
652 コウ
515 ショウ
375 ソウ
373 キョウ
371 トウ
364 シ
353 カン
343 セン
331 キ
311 ケン
@fasiha
fasiha / cream-rgto-jazee-minor.md
Created Apr 25, 2020
Gloss from JAZEE MINOR's rap in Cream's cover of RGTO https://www.youtube.com/watch?v=3uAxSNbOnqw
View cream-rgto-jazee-minor.md

JAZEE MINOR: https://www.youtube.com/watch?v=3uAxSNbOnqw

  • @ しゅういちにちサロレベルガンマせん
    • Vocab
      • 週一日 | 週一日「しゅういちにち」| ① one day a week
        • 週 | 週「しゅう」| ① week
        • 一日 | 一日・1日「いちにち・いちじつ・ひとひ・ひとえ」| ① one day ② first day of the month (👉 ついたち,1)
          • 一 | 一・1・壱・弌・壹「いち」| ① one (👉 ワン,1) ② best ③ first/foremost ④ beginning/start ⑤ ace (playing card) (👉 エース) ⑥ bottom string (on a shamisen, etc.)
          • 日 | 日「にち」| ① Sunday (👉 日曜) (abbreviation) ② day (of the month) ③ counter for days ④ Japan (👉 日本) (abbreviation)