Skip to content

Instantly share code, notes, and snippets.

View fasiha's full-sized avatar
💭
🧘‍♂️🐻

Ahmed Fasih fasiha

💭
🧘‍♂️🐻
View GitHub Profile
@fasiha
fasiha / getOnlineD3.js
Created September 9, 2014 18:44
D3 function to just grab something from the web and into the workspace via XHR
function getOnline(url) {
d3.xhr(url, 'text/plain',
function(err, req) { _response = req.responseText; });
}
// タンポポの{綿毛}が風にふかれて飛ぶ。
// わたげ
// 植物のくきは上の方へのびる{性質}がある。
// せいしつ
// 手あらいをよくして伝染<せん>病を{防}ぐ。
// ふせ
// 父は{常}に「腹<はら>八分目」を心がけている。
// つね
// 母は{雑用}が多くてこまっているようだ。
// ざつよう
@fasiha
fasiha / README.md
Last active August 29, 2015 14:06
My Anki + webserver (CherryPy running as an Anki add-on) + Markdown setup for my *Remembering the Kanji* deck

I keep my Remembering the Kanji deck's contents in a Markdown file that looks like this:


"# 社 company [corporation] "(#1173, kanken 9, freq. 24, シャ やしろ)

"The Overlord is forming a corporation with the under-ground dwarves. But only till he can stab them in the back!"


@fasiha
fasiha / create-ball.js
Last active August 29, 2015 14:06
Three.js codes for Udacity's WebGL course
function createBall() {
var material = new THREE.MeshLambertMaterial( { color: 0x80FC66, shading: THREE.FlatShading } );
material.ambient.setRGB(material.color.r * 0.4, material.color.g * 0.4, material.color.b * 0.4);
var sphere = new THREE.Mesh( new THREE.SphereGeometry( 400, 64, 32 ), material );
return sphere;
}
#!/bin/sh
#
# Search for a term within an Anki deck.
#
# Usage: grepanki.sh someword
# run "grepanki" without any input for more detailed help
#
# You might want to add special aliases to the .bashrc or .bash_profile files
# alias gpj='grepanki' # searches defaultly
# alias gpr='grepanki -r' # searches the reverse direction
@fasiha
fasiha / edict-core5k-nonrtk.md
Last active August 29, 2015 14:08
EDICT and JMdict entries using the 73 non-RTK1 kanji in Tono, et al.'s *A Frequency Dictionary of Japanese*

Introduction

Of the 1503 kanji used in the top 5000 Japanese words according to A Frequency Dictionary of Japanese by Yukio Tono, Makoto Yamazaki, and Kikuo Maekawa (2013), twenty-five don't appear in Heisig's Remembering the Kanji, volume 1. Here is a list of thirty-three entries in EDICT that use one or more of these non-RTK1 kanji, and below that, a much longer list of 610 entries in JMdict that use them.

Edict

ばら撒く [ばらまく] /(v5k,vt) (uk) to disseminate/to scatter/to broadcast/to give money freely/to strew/(P)/
鞄 [かばん] /(n) bag/satchel/briefcase/basket/(P)/
嬉しい [うれしい] /(adj-i) (uk) happy/glad/pleasant/(P)/
金儲け [かねもうけ] /(n,vs) money-making/(P)/
撒く [まく] /(v5k,vt) (1) to scatter/to sprinkle/to strew/(2) to distribute (handbills, etc.)/to spread (rumours, etc.)/(3) to give the slip/to throw off/to shake off/to lose/(P)/
吹き溜まり [ふきだまり] /(n) (1) drift of snow or leaves/(2) hangout for drifters/(P)/

@fasiha
fasiha / answer.md
Last active August 29, 2015 14:08
IDSgrep and CJKVI queries to answer the question: "How often does 艹 appear on top of a left-right combination like 荻 versus above just the right-side like 塔?"

How often does 艹 appear on top of a left-right combination like 荻 versus above just the right-side like 塔?

Let's ask IDSgrep and the KanjiVG database!

艹 as a crown: 275 Japanese characters

Searching for ⿱艹? in dict/kanjivg.eids:
【繭】⿱艹?
【舊】⿱艹?
【艾】⿱艹乂

@fasiha
fasiha / sljfaq-email.md
Last active August 29, 2015 14:08
Response to Ben Bullock of Sljfaq regarding a request to make a public API to the Sljfaq kanji recognizer

Demo: Anki and iframes for practicing kanji handwriting.

Summary

Here's an (edited) message I wrote to Ben Bullock of sljfaq demonstrating how one could embed an iframe in Anki cards, load a remote website in that iframe, and get selections therein back to Anki, with a request that such a feature be added to the kanji recognizer.

If you're interested in this, please post a message endorsing the idea to the sljfaq Google group.

Background

Anki is a popular flashcard app in which flashcards are basically HTML/CSS/Javascript pages, so in

@fasiha
fasiha / han.js
Last active August 29, 2015 14:09
XRegExp's definition for Han (CJK) characters as a regular expression group
XRegExp('\\p{Han}')
// [⺀-⺙⺛-⻳⼀-⿕々〇〡-〩〸-〻㐀-䶵一-鿌豈-舘並-龎]
@fasiha
fasiha / example.js
Created November 14, 2014 17:52
Splitting extra-BMP characters like in my RTK1 graph
s = '卯 : 𠂎卩𠃜目"wasa\'p"目';
s.split(' : ')[1].split(XRegExp('(?=[\uD800-\uDBFF][\uDC00-\uDFFF]|\\p{Han}|"[^"]+")','g'))
// [ "𠂎", "卩", "𠃜", "目", ""wasa'p"", "目" ]