Skip to content

Instantly share code, notes, and snippets.

@illvart
illvart / 20-intel.conf
Last active December 12, 2020 02:56
My Linux system setup
# /etc/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "TearFree" "true" # Tearing
Option "DRI" "2" # DRI3 is now default
#Option "AccelMethod" "sna" # default
#Option "AccelMethod" "uxa" # fallback
@illvart
illvart / cloudSettings
Last active March 22, 2020 20:30
VSCode - Visual Studio Code (code|code-oss - /usr/bin/code --unity-launch %F) Settings Sync Gist
{"lastUpload":"2020-03-22T20:30:31.296Z","extensionVersion":"v3.4.3"}
@illvart
illvart / netlify.toml
Created January 12, 2020 14:05
netlify.toml (netlify.com) config
[build]
publish = "public"
command = "yarn build" # or gulp default
[[headers]]
for = "/*"
[headers.values]
X-Content-Type-Options = "nosniff"
Strict-Transport-Security = "max-age=31536000"
Referrer-Policy = "no-referrer-when-downgrade"
@illvart
illvart / now.md
Last active January 13, 2020 15:59
now.json (zeit.co) config

@now/static

{
  "name": "illvart",
  "version": 2,
  "builds": [{ "src": "./public/**", "use": "@now/static" }],
  "routes": [
    { "src": "/(.*)", "dest": "public/$1" },
    { "handle": "filesystem" },
 { "src": "/.*", "status": 404, "dest": "public/404.html" }
@illvart
illvart / regexCheatsheet.js
Created December 17, 2019 12:01 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
@illvart
illvart / regex.md
Created December 17, 2019 11:44 — forked from vitorbritto/regex.md
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping
@illvart
illvart / client.js
Created November 23, 2019 10:37 — forked from aerrity/client.js
Node, Express & MongoDB: Button click example
console.log('Client-side code running');
const button = document.getElementById('myButton');
button.addEventListener('click', function(e) {
console.log('button was clicked');
fetch('/clicked', {method: 'POST'})
.then(function(response) {
if(response.ok) {
console.log('click was recorded');
@illvart
illvart / smooth-scrolling-polyfill.md
Created November 14, 2019 19:58 — forked from eyecatchup/smooth-scrolling-polyfill.md
Smooth Scroll behavior polyfill

The Scroll Behavior specification has been introduced as an extension of the Window interface to allow for the developer to opt in to native smooth scrolling. To date this has only been implemented in Chrome, Firefox and Opera.

There's a complete polyfill here (3.3KB minified). But most of the times, the following is enough for me (641 bytes minified):

smooth-scrolling-poyfill.js

Use as: scrollToElem('#elem-selector');

@illvart
illvart / GPG.md
Last active October 22, 2019 12:46
Create a SSH and GPG
@illvart
illvart / PageList.md
Last active October 22, 2019 12:39
Blogger b:widget type='PageList' lebih lanjut

Blogger b:widget type='PageList'

Kelebihan PageList sangat banyak. Mendukung SEO, Structured Data, UI/UX, url lebih lanjut untuk variant dll. Perhatikan codenya.

  • cond='not data:link.id' bisa untuk membuat attribute rel='nofollow noopener' hanya ada di link external bukan internal (seperti halaman labels, pages, dll).
  • cond='data:link.isCurrentPage' menghilangkan attribute target='_blank' jika halaman yang dikunjungi saat ini (untuk meningkatkan peformance Google Analytics).
  • cond='data:view.isHomepage and data:link.id' untuk menghilangkan attribute itemprop='url' dan itemprop='name' jika itu link external (karena logikanya SiteNavigationElement di halaman Google akan tampil hanya link internal jika external yakali promosi, lihat aja contohnya seperti GitHub - ketikan GitHub di google maka ada navigasi menu seperti Sign up, Collections nah itu SiteNavigationElement).

Dan untuk SiteNavigationElement hanya ditampilkan di halaman depan! Karena log