Skip to content

Instantly share code, notes, and snippets.

View ZibanPirate's full-sized avatar
🇩🇪
8 hours on work, the rest on dzcode und algeriastartupjobs

Zakaria Mansouri ZibanPirate

🇩🇪
8 hours on work, the rest on dzcode und algeriastartupjobs
View GitHub Profile
@Fcmam5
Fcmam5 / ber.js
Last active February 10, 2021 13:40
Berber (Tifinagh) regex
const REGEX = /^[\u2D30-\u2D7F\\s]+$/
// Examples
console.log(REGEX.test("ⵡⴻⵀⵔⴰⵏ")); // True
console.log(REGEX.test("Oran")); // False
@Slauta
Slauta / .gitlab-ci
Last active March 18, 2024 16:53
electron-updater from private repo gitlab.com
variables:
VERSION_ID: '1.0.$CI_PIPELINE_ID'
stages:
- build
build:
image: slauta93/electron-builder-win
stage: build
artifacts:
@JamesMGreene
JamesMGreene / .editorconfig
Created November 16, 2015 12:04
Example EditorConfig file
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
end_of_line = lf
charset = utf-8
@getify
getify / gist:3667624
Last active June 25, 2022 16:26
escape all (not-already-escaped) double-quote chars in a string
// NOTE: only escapes a " if it's not already escaped
function escapeDoubleQuotes(str) {
return str.replace(/\\([\s\S])|(")/g,"\\$1$2"); // thanks @slevithan!
}
escapeDoubleQuotes(`ab`); // ab => ab (nothing escaped)
escapeDoubleQuotes(`a"b`); // a"b => a\"b
escapeDoubleQuotes(`a\\"b`); // a\"b => a\"b (nothing escaped)
escapeDoubleQuotes(`a\\\\"b`); // a\\"b => a\\\"b
escapeDoubleQuotes(`a\\\\\\"b`); // a\\\"b => a\\\"b (nothing escaped)