Skip to content

Instantly share code, notes, and snippets.

In case of fire: git commit, git push, leave the building!

Dalibor Gogic daliborgogic

In case of fire: git commit, git push, leave the building!
Block or report user

Report or block daliborgogic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nuxt-netlify-http2-server-push-module.js
const debug = require('debug')('nuxt:netlify-http2-server-push');
const path = require('path');
const glob = require('glob');
const fs = require('fs');
module.exports = function module(moduleOptions) {
// This module is only enabled on production builds
if ( {
addyosmani /
Last active Nov 14, 2019
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()
JamieMason /
Last active Feb 25, 2019
Access deeply nested value in JavaScript

Access deeply nested value in JavaScript

Loose Version

const complete = {
  foo: {
    bar: {
      baz: 'hello'
View Postman.desktop
[Desktop Entry]
daliborgogic / delay.js
Created Dec 16, 2016
Node.js Async/Await delay
View delay.js
'use strict'
const timeout = ms => new Promise(res => setTimeout(res, ms))
function convinceMe (convince) {
let unixTime = Math.round(+new Date() / 1000)
console.log(`Delay ${convince} at ${unixTime}`)
async function delay () {
joshcanhelp / scrollTo.js
Last active Dec 11, 2019
Animated scrollTo for specific element or top of page
View scrollTo.js
// Smooth scroll-to inspired by:
module.exports = function (scrollTo, scrollDuration) {
// Set a default for where we're scrolling to
yunghoy / gist:a425f91824d26461bb2e3653bc56ebbf
Last active Oct 3, 2019
AMQP library (RabbitMQ) - async/await
View gist:a425f91824d26461bb2e3653bc56ebbf
alias babel-node='babel-node --presets stage-0'
------ RECV ------
// babel-node recv2.js "#"
// babel-node recv2.js "kern.*"
const amqp = require('amqplib');
const args = process.argv.slice(2);
if (args.length == 0) {
View IE CSS Hacks All - IE6, 7, 8, 9, 10, 11, Edge
" Make IE Better Compatible "
<!--[if IE]>
<script src=""></script>
IE6 Only
_selector {...}
BinaryMuse / restful.js
Last active Mar 17, 2019
Express API with Async/Await
View restful.js
import express from "express";
* Takes a route handling function and returns a function
* that wraps it after first checking that the strings in
* `reserved` are not part of `req.body`. Used for ensuring
* create and update requests do not overwrite server-generated
* values.
function checkReservedParams(routeHandler, ...reserved) {
addyosmani /
Last active Dec 11, 2019 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

You can’t perform that action at this time.