Skip to content

Instantly share code, notes, and snippets.

View jakub-g's full-sized avatar

jakub-g jakub-g

  • Antibes, France
  • 03:48 (UTC +02:00)
View GitHub Profile
@jakub-g
jakub-g / es2016+.md
Last active May 14, 2020 20:13
UC browser vs Chromium: Kangax ES2016+ tests
@jakub-g
jakub-g / gist:b7b54852011dfd8d708fa88300452f5a
Created May 12, 2020 09:49
Samsung TV browser and Samsung TV webview useragent strings
Samsung Browser:
----------------
Mozilla/5.0 (SMART-TV; Linux; Tizen 5.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.2 Chrome/63.0.3239.84 TV Safari/537.36
Mozilla/5.0 (SMART-TV; Linux; Tizen 4.0) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/2.1 Chrome/56.0.2924.0 TV Safari/537.36
Samsung WebView:
----------------
Mozilla/5.0 (SMART-TV; LINUX; Tizen 5.0) AppleWebKit/537.36 (KHTML, like Gecko) Version/5.0 TV Safari/537.36
@jakub-g
jakub-g / string-replace-nodejs-in-bash.sh
Created April 20, 2020 08:01
Use nodejs in bash script for string manipulation
$ echo "FOO_BAR" | node -p 'require("fs").readFileSync(process.stdin.fd, "utf-8").replace("_", "..")'
FOO..BAR
@jakub-g
jakub-g / Intl.DateTimeFormat.js
Created April 17, 2020 15:04
Intl.DateTimeFormat
new Intl.DateTimeFormat('en-GB', {timeZone: 'Europe/Paris',
year: 'numeric',
month: 'long',
day: 'numeric',
hour: 'numeric',
minute: 'numeric'
}).format(new Date())
// "17 April 2020, 17:03"
@jakub-g
jakub-g / filter.txt
Created April 15, 2020 18:31
vscode exclude filters
*.spec.js*, bin, tools, *webpack*, spec/*, karma*
@jakub-g
jakub-g / safari-release-notes-history+stable-technical-preview-mapping.md
Last active February 22, 2023 02:33
Mapping Safari releases to Safari TP versions
@jakub-g
jakub-g / 1-unicode-js-regex.md
Last active December 22, 2022 08:03
Unicode-aware JavaScript regex cheat sheet

Unicode-aware JavaScript regex (Unicode property escapes /\p{..}\P{..}/u) cheat sheet

Browser support MDN

@jakub-g
jakub-g / regex-u-test.js
Last active April 2, 2020 19:18
regex u flag test
console.log("Wikipedia Википедия Wikipedia Βικιπαίδεια Wikipedia".match(/\p{Letter}+/gu))
console.log("Wikipedia Википедия Wikipedia Βικιπαίδεια Wikipedia".match(/\b\p{Letter}+\b/gu))
@jakub-g
jakub-g / cd-to-git-root.sh
Last active February 25, 2020 15:09
go to root folder of git repo from a bash script
#!/bin/bash
# first, switch to the directory of where the currently executing script is located
cd "$( dirname "${BASH_SOURCE[0]}" )"
# now, find the git repo root, and switch to that directory
cd "./"$(git rev-parse --show-cdup)
# now, run stuff from the git root
./somefolder/do-stuff.sh
<?php
$remote = @$_SERVER['REMOTE_ADDR'];
printf("%s\n", (($name = gethostbyaddr($remote)) !== false) ? $name : $remote);