Skip to content

Instantly share code, notes, and snippets.

🐙
oink

Houssam Salem hssm

🐙
oink
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am hssm on github.
  • I am hssm (https://keybase.io/hssm) on keybase.
  • I have a public key ASA3sybSj_5DSHPJcAGaI5JYY3j8byuD3_RgitmbvcYWdgo

To claim this, I am signing this object:

@hssm
hssm / 1 - Core template.md
Last active Jan 8, 2020
Japanese core deck template
View 1 - Core template.md

Anki template for the popular Japanese Core (2k 6k 10k etc) decks.

I highgly recommend you use the VL PGothic font. Download it, extract it, and place the VL-PGothic-Regular.ttf file inside your collection.media directory and rename it to _VLPGothic.ttf.

Front side:


@hssm
hssm / about.md
Last active Jul 7, 2016
A solution and demo for deciding if text should be black or white depending on the background color it is being placed on to guarantee readability.
View about.md

Do you need a way to decide if text should be black or white depending on the background it is drawn on? This gist contains a simple and effective solution with a demonstration.

The color choice is calculated by hand-crafted rules derived by mere human inspection. Don't like how it works for a certain range? You can easily tweak the numbers for that range.

@hssm
hssm / visibility_test.html
Last active Jul 7, 2016
An early attempt at deciding on a text color to ensure visibility using some approaches I found on SO. It doesn't work very well.
View visibility_test.html
<html>
<head>
<meta charset="utf-8">
<style>
.box {
width: 80px;
height: 80px;
padding: 5px;
line-height: 2em;
text-align: center;
@hssm
hssm / latch.html
Last active Feb 14, 2016
Auto-scroll page to bottom when new content is added, but stop auto-scrolling if user scrolls up
View latch.html
<!DOCTYPE html5>
<html>
<head>
<meta charset="utf-8" />
<title>Latch to bottom unless scrolled up</title>
<script>
document.addEventListener("DOMNodeInserted", function () {
var b = document.body;
// Additional padding/border to account for in calculations
You can’t perform that action at this time.