Skip to content

Instantly share code, notes, and snippets.

Farhad fhdhsni

Block or report user

Report or block fhdhsni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fhdhsni
fhdhsni / erik-meijer-books.md
Created Jan 7, 2019 — forked from jameskolce/erik-meijer-books.md
Erik Meijer’s List of Recommended Books
View erik-meijer-books.md

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
my emacs mode line config
View mode-line.el
(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 Feb 18, 2017
2017-02-18 pacman.log
View 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 Nov 18, 2016
getting keycode and keysym of keys
View key.txt
xmodmap -pke
or
xev
@fhdhsni
fhdhsni / ultimate-ut-cheat-sheet.md
Created Oct 8, 2016 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon
View ultimate-ut-cheat-sheet.md

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


View script.js
// 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 Mar 17, 2019
Using Microsoft Natural Ergonomic Keyboard 4000 zoom slider in arch linux/ubuntu
View gist:754cf110ef27217ada7034a84a4355c6
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/
You can’t perform that action at this time.