Skip to content

Instantly share code, notes, and snippets.

@fhdhsni
fhdhsni / erik-meijer-books.md
Created January 7, 2019 19:43
Erik Meijer’s List of Recommended Books

Erik Meijer’s List of Recommended Books

  1. Logic and Computation: Interactive Proof with Cambridge LCF (Cambridge Tracts in Theoretical Computer Science)
  2. Mathematical Theory of Programme Correctness (Prentice-Hall International series in computer science)
  3. The Haskell School of Expression: Learning Functional Programming through Multimedia
  4. LaTeX: A Document Preparation System (2nd Edition)
  5. Denotational Semantics
  6. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory
  7. Programs and Machines
  8. The Denotational Description of Programming Languages: An Introduction
@fhdhsni
fhdhsni / mode-line.el
Created May 24, 2017 17:31
my emacs mode line config
(defun mode-line-fill-right (face reserve)
"Return empty space using FACE and leaving RESERVE space on the right."
(unless reserve
(setq reserve 20))
(when (and window-system (eq 'right (get-scroll-bar-mode)))
(setq reserve (- reserve 3)))
(propertize " "
'display `((space :align-to (- (+ right right-fringe right-margin) ,reserve)))
'face face))
@fhdhsni
fhdhsni / pacman.log
Created February 18, 2017 16:23
2017-02-18 pacman.log
[2017-02-18 04:29] [PACMAN] Running 'pacman -Suy'
[2017-02-18 04:29] [PACMAN] synchronizing package lists
[2017-02-18 04:29] [PACMAN] starting full system upgrade
[2017-02-18 05:05] [ALPM] running 'texinfo-remove.hook'...
[2017-02-18 05:05] [ALPM] transaction started
[2017-02-18 05:05] [ALPM] upgraded tslib (1.3-1 -> 1.5-1)
[2017-02-18 05:05] [ALPM] upgraded ncurses (6.0+20161224-1 -> 6.0+20170128-1)
[2017-02-18 05:05] [ALPM] upgraded readline (7.0.001-1 -> 7.0.003-1)
[2017-02-18 05:05] [ALPM] upgraded bash (4.4.011-2 -> 4.4.012-1)
[2017-02-18 05:05] [ALPM] upgraded libsystemd (232-7 -> 232-8)
@fhdhsni
fhdhsni / key.txt
Created November 18, 2016 19:00
getting keycode and keysym of keys
xmodmap -pke
or
xev
@fhdhsni
fhdhsni / ultimate-ut-cheat-sheet.md
Created October 8, 2016 12:42 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


// Secret life of JS objects
"use strict";
(() => {
const MOUNTAINS = require("./mountains");
function rowHeights(rows) {
// We have 8 row(Three are 8 array in rows). We wanna find out how many line(height) each row needs. Only the first row(header) needs 2 line becuase it has an underline
// it returns [ 2, 1, 1, 1, 1, 1, 1, 1 ]
// Why the first element is 2? it's the header. remember UnderlinedCell.prototype.minHeight returns this.inner.minHeight() + 1;
return rows.map(function(row) {
/* remember each row is an array. sth like ->
@fhdhsni
fhdhsni / gist:754cf110ef27217ada7034a84a4355c6
Last active January 17, 2020 17:50
Using Microsoft Natural Ergonomic Keyboard 4000 zoom slider in arch linux/ubuntu
sudo vim /usr/lib/udev/hwdb.d/60-keyboard.hwdb
sudo vim /lib/udev/hwdb.d/60-keyboard.hwdb # for Ubuntu
# edit section # Microsoft Natural Ergonomic Keyboard 4000
# as you like
sudo udevadm hwdb --update
# unplug and plug back in the keyboard
from http://blog.philippklaus.de/2012/05/microsoft-natural-ergonomic-keyboard-4000-with-mac-os-x-and-linux/