Skip to content

Instantly share code, notes, and snippets.

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

Ahmed Fasih fasiha

💭
🧘‍♂️🐻
View GitHub Profile
@fasiha
fasiha / README.md
Last active August 16, 2023 06:56
Understanding overlapping memory transfers and kernel execution for simple CUDA workflows

Understanding overlapping memory transfers and kernel execution for very simple CUDA workflows

Executive summary

This small exploration started when Dr Jon Rogers mentioned that one could get overlapping memory transfer and kernel execution by using device-mapped page-locked host memory (see section 3.2.4, Page-Locked Host Memory, of the CUDA C Programming Guide version 6.0) even for simple CUDA workflows, i.e., copying some data from the host to device, operating on that data on the device, and

@fasiha
fasiha / userscript.js
Last active August 29, 2015 14:04
Show Tangorin.com's kanji stroke order in Koohii kanji study section (Chrome Tampermonkey & Firefox Greasemonkey script)
// ==UserScript==
// @name Koohii Study section stroke order
// @namespace koohiistudy
// @version 0.1
// @description Adds Tangorin kanji stroke order, and expands Sample Words
// @match http://kanji.koohii.com/study/kanji*
// @match https://kanji.koohii.com/study/kanji*
// @grant GM_xmlhttpRequest
// ==/UserScript==
@fasiha
fasiha / stylish.css
Created July 21, 2014 03:50
Stylish (Chrome extension) style to use locally-installed Kanji Stroke Order font (if available) for Koohii.com's kanji study section
/* Stylish (Chrome extension) style to use locally-installed
Kanji Stroke Order font (if available) for Koohii.com's kanji
study section */
@font-face {
font-family: 'kanjistrokeorder-local';
src:
local('KanjiStrokeOrders'),
local('KanjiStrokeOrders.ttf');
}
@fasiha
fasiha / memrise_disable_timer.js
Created July 24, 2014 12:37
Disables the Timer on watering & gardening levels in Memrise.com
// ==UserScript==
// @name Memrise Timer Disabler
// @description Disables the Timer on watering & gardening levels in Memrise.com
// @match http://www.memrise.com/course/*/garden/*
// @version 0.1.1
// @updateURL https://userscripts.org/scripts/source/174879.meta.js
// @downloadURL https://userscripts.org/scripts/source/174879.user.js
// @grant none
// ==/UserScript==
/* Clear background image */
body.memrise.fullscreen.garden {
background-size:100%;
background-repeat:no-repeat;
}
/* Put a huge gap between the questions and answers to avoid contamination */
.typing-wrapper, ol.choices { margin-top: 34em !important; }
/* Use Japanese fonts. Sorry Chinese learners. */
@fasiha
fasiha / README.md
Last active August 29, 2015 14:05
Component analysis of the 2200 kanji in Heisig's Remembering the Kanji using the KanjiVG database

Component graph

This component graph shouldn't be confused for a dependency graph; it is rather an inverse of that. It shows, for each of the 2200 kanji, which kanji reference it in their KanjiVG descriptors. The first kanji per line is a dependency of all the kanji that follow it on that line.

Leaf nodes

The list of 1670 kanji is the subset of the total list of 2200 Remembering the Kanji, Volume 1 (6th edition) kanji that are not referenced in the KanjiVG descriptors for those 2200 kanji.

@fasiha
fasiha / README.md
Last active August 29, 2015 14:05
D3.js: 2D matrix to 3D nested lists: an elaboration of Mike Bostock's table example using lists

Based on https://github.com/mbostock/d3/wiki/Selections#Data where a 2D matrix is used to produce a table. Here we use it to produce a 3-deep nested HTML list, showing that the technique works when chaining "ul > li" tags and when making up new data based on individual elements of the original matrix.

Produces

  • Row 0
    • 11975
      • 11975
      • 1197.5
      • 119.75
  • 5871
@fasiha
fasiha / snippet__print_due_cards.py
Created September 3, 2014 14:06
Snippet for running in the Anki Debug Window (Control+:, i.e., Control colon): print out all due cards' questions
# How many cards to print?
cardsToPrint = 250
# By default, the Anki scheduler will just show you 50 cards due. Where does it get off???
mw.col.sched.queueLimit = cardsToPrint + 1
# Don't print cards that have already been printed: this will store card IDs as we print them
seen = {}
# Let's do this!!!
@fasiha
fasiha / README.md
Last active March 31, 2020 03:50
Stand-alone script version of Japanese Support Anki add-on to add readings using MeCab and Kakasi

Standalone Japanese reading generator based on Damien Elmes' Japanese Support plugin for Anki: https://ankiweb.net/shared/info/3918629684

This script does not need Anki to run, but it does use the MeCab and Kakasi applications included in the Japanese Support plugin. You are expected to download that plugin and place this file inside your <Documents/Anki/addons/japanese/> directory alongside reading.py and run it from the command line.

@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; });
}