Skip to content

Instantly share code, notes, and snippets.

@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

@illvart
illvart / gist:2605049998e9c787774e43ccb4dc5ddf
Created July 10, 2019 05:03 — forked from paulirish/gist:5558557
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@illvart
illvart / unpublish.md
Created June 1, 2019 12:49
npm unpublish
npm login
npm unpublish @username/package@1.0.0
npm deprecate @username/package@1.0.0 "Hey, please use the latest version"
@illvart
illvart / log.js
Last active May 28, 2019 16:48
Gulp log
const through = require("through2");
const verify = title => {
const write = (file, enc, cb) => {
console.log("File", file.path);
cb(null, file);
};
const end = cb => {
console.log(`${title} done!`);
cb();
@illvart
illvart / babel.config.js
Created May 28, 2019 15:51
Gulp ES6 with babel: yarn add --dev gulp @babel/core @babel/preset-env @babel/register iltorb
module.exports = {
presets: [
[
"@babel/preset-env",
{
targets: {
node: "current"
}
}
]
@illvart
illvart / ntfs-3g.md
Last active May 28, 2019 12:50
Fix NTFS-3G for NTFS partition used on node_modules

/etc/fstab

/dev/NTFS-partition  /mnt/windows  ntfs-3g  uid=userid,gid=groupid,rw  0 0

find a uid and gid:

id username
@illvart
illvart / BlogPosting.json
Last active May 26, 2019 08:13
BlogPosting
{
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "URL post"
},
"image": "URL image post",
"headline": "Title post",
"datePublished": "2019-01-08T08:39:00+07:00",
@illvart
illvart / package.json
Last active June 1, 2019 12:51
Example Workbox CLI
{
"devDependencies": {
"babel-minify": "^0.5.0",
"workbox-cli": "^4.3.1"
},
"scripts": {
"inject-manifest": "workbox injectManifest && minify --mangle.topLevel ./static/sw.js --outFile ./static/sw.js"
}
}
@illvart
illvart / netlify.toml
Last active June 18, 2019 21:05
Example netlify.toml with the security headers and webhint
[build]
publish = "static"
command = "yarn inject-manifest"
[[headers]]
for = "/*"
[headers.values]
X-Content-Type-Options = "nosniff"
Strict-Transport-Security = "max-age=31536000"
Referrer-Policy = "no-referrer-when-downgrade"
@illvart
illvart / hosts
Last active May 25, 2019 05:08
Hosts file for Reddit includes Imgur and Vimeo
## Unblock Reddit
## Original source http://pastebin.com/raw/0ezeV2yR
151.101.129.140 reddit.com
151.101.129.140 ww.reddit.com
151.101.129.140 www.reddit.com
151.101.129.140 ssl.reddit.com
151.101.129.140 4x.reddit.com
151.101.129.140 about.reddit.com
151.101.129.140 blog.reddit.com