Skip to content

Instantly share code, notes, and snippets.

[Desktop Entry]
Version=1.0
Name=Firefox Developer Edition
Comment=Firefox Developer Edition
Exec=/opt/firefox-dev/firefox
# Path=/opt/firefox-dev/firefox
Icon=/opt/firefox-dev/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application
Categories=Browser;Development;
const tree = {
value: 1,
children: [
{
value: 10,
children: [
{
value: 2,
},
],
@antlis
antlis / ga-2019.pug
Created August 16, 2019 09:51
GTAG Script 2019, pug mixin
mixin ga(id)
script(async='', src='https://www.googletagmanager.com/gtag/js?id='+id)
script.
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', '!{id}')
@antlis
antlis / svg-icon.pug
Created August 15, 2019 10:21
Pug mixin that will output svg icon, in case you use svg sprites
mixin svgIcon(iconId)
i(class="icon icon--"+iconId)
svg.icon__svg
use(xlink:href='#'+iconId)
@antlis
antlis / ga-html5boilerplate.pug
Last active August 21, 2019 03:39
Google analytics pug mixin, HTML5 boilerplate like
mixin ga(id)
//- Pass your ga id, as attribute, eg. +ga('yourid12345')
script.
window.ga = function () { ga.q.push(arguments) }; ga.q = []; ga.l = +new Date;
ga('create', '!{id}', 'auto'); ga('set','transport','beacon'); ga('send', 'pageview')
script(src='https://www.google-analytics.com/analytics.js')
mixin breadcrumb(pages)
nav.breadcrumb
ol.breadcrumb__list(itemscope itemtype='http://schema.org/BreadcrumbList')
each item, index in pages
li.breadcrumb__list-item(itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem')
if index != pages.length - 1
a.breadcrumb__item(href="#0")
span(itemprop="name")= item
span.breadcrumb__separator /
meta(itemprop='position' content=(index + 1))
[[- https://stackoverflow.com/questions/54362229/getting-seo-errors-with-breadcrumblist]]
[[pdoCrumbs?
&tplWrapper=`@INLINE
<nav class="breadcrumb">
<ol class="breadcrumb__list" itemscope itemtype="http://schema.org/BreadcrumbList">
[[+output]]
</ol>
</nav>`
&tpl=`@INLINE
// https://developers.google.com/recaptcha/docs/invisible
// https://developers.google.com/recaptcha/docs/invisible#render_param
// https://github.com/thiamsantos/invisible-grecaptcha
import {
execute,
destroy
} from 'invisible-grecaptcha'
export default class GoogleInvisibleRecaptcha {
@antlis
antlis / ffmpeg_twitch.sh
Created January 8, 2018 21:57
Twitch streaming via ffmpeg
# https://wiki.archlinux.org/index.php/Streaming_to_twitch.tv
streaming() {
INRES="1920x1080" # input resolution
OUTRES="1920x1080" # output resolution
FPS="15" # target FPS
GOP="30" # i-frame interval, should be double of FPS,
GOPMIN="15" # min i-frame interval, should be equal to fps,
THREADS="2" # max 6
CBR="1000k" # constant bitrate (should be between 1000k - 3000k)