Skip to content

Instantly share code, notes, and snippets.

View Heziode's full-sized avatar
👨‍🎓
PhD student

Quentin Dauprat Heziode

👨‍🎓
PhD student
View GitHub Profile
@tkrotoff
tkrotoff / #calculator.ts
Last active April 9, 2024 14:45
Calculator function using shunting yard algorithm and reverse Polish notation (RPN)
// https://gist.github.com/tkrotoff/b0b1d39da340f5fc6c5e2a79a8b6cec0
// WTF!
// parseFloat('-0') => -0 vs parseFloat(-0) => 0
// -0 === 0 => true vs Object.is(-0, 0) => false
const minus0Hack = (value: number) => (Object.is(value, -0) ? '-0' : value);
export const operators: {
[operator: string]:
| {
@nupplaphil
nupplaphil / headless-luks-encrypted-debian-server-with-uefi.md
Last active November 16, 2023 15:58 — forked from jkullick/headless-luks-encrypted-ubuntu-server.md
Headless LUKS encrypted Debian Server with UEFI
# stop active raid
mdadm --stop /dev/md[01]

# destroy partition table on hdds
dd if=/dev/zero of=/dev/sda bs=1M count=512
dd if=/dev/zero of=/dev/sdb bs=1M count=512
dd if=/dev/zero of=/dev/sdc bs=1M count=512
dd if=/dev/zero of=/dev/sdd bs=1M count=512
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active June 25, 2024 15:37
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html

@keyvanakbary
keyvanakbary / httpurl.coffee
Last active February 4, 2021 10:16
Http URL regex based on RFC 1738
class HttpUrl
ALPHA = "[a-zA-Z]"
DIGIT = "[0-9]"
DIGITS = "#{DIGIT}+"
SAFE = "[-$_.+]"
EXTRA = "[!*'(),]"
ALPHADIGIT = "[a-zA-Z0-9]"
TOPLABEL = "#{ALPHA}(#{ALPHADIGIT}|-)*#{ALPHADIGIT}|#{ALPHA}"