Skip to content

Instantly share code, notes, and snippets.

View leviem1's full-sized avatar
🏗️
Building

Levi Muniz leviem1

🏗️
Building
View GitHub Profile
@leviem1
leviem1 / match-pessimistic-version.js
Created May 12, 2021 23:32
Pessimistically match a version in a string
/*
Pessimistically match a version string (e.g. 1.2.3) in string.
Works with https://tc39.es/ecma262/ (2018).
Pessimistic versioning:
https://web.archive.org/web/20201027204727/https://macwright.com/2016/08/23/optimistic-pessimistic-versioning.html
https://web.archive.org/web/20210331060738/https://thoughtbot.com/blog/rubys-pessimistic-operator
*/
function pessimisticMatch(string, version) {
return new RegExp(`(?<!(\\.|[0-9]))${version}(\\.[0-9]*)*(?!.+)`).test(string);
@leviem1
leviem1 / sources.list
Created March 7, 2022 15:44 — forked from rhuancarlos/sources.list
Ubuntu 18.04 Bionic default /etc/apt/sources.list
#deb cdrom:[Ubuntu 18.04 LTS _Bionic Beaver_ - Release amd64 (20180426)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
@leviem1
leviem1 / fangxiao-domains-pihole-blocklist-11-2022
Last active May 6, 2023 11:15
PiHole blocklist for phishing domains used by Fangxiao: bleepingcomputer.com/news/security/42-000-sites-used-to-trap-users-in-brand-impersonation-scheme/
This file has been truncated, but you can view the full file.
0.0.0.0 002sen.cn
0.0.0.0 003bty.cyou
0.0.0.0 005nj7z.cn
0.0.0.0 006ks4g.cn
0.0.0.0 0072875.xyz
0.0.0.0 0099q7e.cn
0.0.0.0 009gfy.cyou
0.0.0.0 00ckpr.cn
0.0.0.0 00cojpj.cn
0.0.0.0 00cvl.cn