Skip to content

Instantly share code, notes, and snippets.

@BukhariH
BukhariH / tomorrow-night-eighties.puml
Last active April 29, 2020 22:25
A dark theme for PUML
@startuml PlantUML Color Themes - Tomorrow Night Eighties
' "Tomorrow night eighties" color theme (see https://github.com/chriskempson/tomorrow-theme)
!define Background #2d2d2d
!define CurrentLine #393939
!define Selection #515151
!define Foregound #cccccc
!define Comment #999999
!define Red #f2777a
!define Orange #f99157
@BukhariH
BukhariH / slope_vs_starting.md
Created December 3, 2019 00:56 — forked from gtallen1187/slope_vs_starting.md
A little bit of slope makes up for a lot of y-intercept

"A little bit of slope makes up for a lot of y-intercept"

01/13/2012. From a lecture by Professor John Ousterhout at Stanford, class CS140

Here's today's thought for the weekend. A little bit of slope makes up for a lot of Y-intercept.

[Laughter]

@BukhariH
BukhariH / BigDecimal_Tolerance.java
Created August 17, 2018 12:37
Checks if a BigDecimal is with in a tolerance value
private static boolean isWithinTolerance(BigDecimal amount, BigDecimal tolerance) {
return (amount.compareTo(tolerance.negate()) > 0 && amount.compareTo(tolerance) < 0)
|| amount.abs().compareTo(tolerance) == 0;
}
@BukhariH
BukhariH / MomentBetweenDates.js
Created June 6, 2018 14:52
Get dates between two moment objects
enumerateDaysBetweenDates = (startDate, endDate) => {
const now = startDate.clone().startOf("day");
const dates = [];
while (now.isSameOrBefore(endDate.startOf("day"))) {
dates.push(now.format("YYYY-MM-DD"));
now.add(1, "days");
}
return dates;
};
@BukhariH
BukhariH / MomentBetweenDatesjs
Created June 6, 2018 14:52
Get dates between two moment objects
enumerateDaysBetweenDates = (startDate, endDate) => {
const now = startDate.clone().startOf("day");
const dates = [];
while (now.isSameOrBefore(endDate.startOf("day"))) {
dates.push(now.format("YYYY-MM-DD"));
now.add(1, "days");
}
return dates;
};
@BukhariH
BukhariH / SimpleLogger.js
Created December 4, 2017 16:09
Simple ES6 Logger
const logger = (() => {
let log = "";
return {
add: msg => log += msg + "\n",
show: () => console.log(log)
}
})();
// Turns [1,2,2,2] into [1,2]
const arr = [1,2,2,2]
[...new Set(arr)]

Keybase proof

I hereby claim:

  • I am bukharih on github.
  • I am bukharih (https://keybase.io/bukharih) on keybase.
  • I have a public key whose fingerprint is 5C4D 1BD3 7DEA 43CA D54C 633C E04C F879 7C01 7AE5

To claim this, I am signing this object:

@BukhariH
BukhariH / Delete All Node Modules.sh
Created October 9, 2017 15:26
Delete All Node Modules via Term
find . -name "node_modules" -exec rm -rf '{}' +
@BukhariH
BukhariH / Merge Last Two Commits.sh
Created September 28, 2017 18:06
Merge Last Two Commits
git reset --soft "HEAD^"
git commit --amend