Skip to content

Instantly share code, notes, and snippets.


ajv andreasvirkus

Block or report user

Report or block andreasvirkus

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 index.html
<p>Photos by <a href="">random photographers</a> on <a href="">Unsplash</a></p>
<img lazy data-src="">
<img lazy data-src="">
<img lazy data-src="">
<img lazy data-src="">
View minimalJquery.js
// Minimal jQuery
const $$ = document.querySelectorAll.bind(document);
const $ = document.querySelector.bind(document);
View firstAncestor.js
const firstAncestor = (el, tagName) => {
while(el = el.parentNode && (el.tagName !== tagName.toUpperCase()))
return el
// Usage
var child = document.getElementById('child')
firstAncestor(child, 'div'); //<div id="parent">
View getPackageVersion.json
"name": "ver-extractor",
"description": "Get the version from your package.json",
"scripts": {
"get-version": "node -pe \"require('./package.json').version\""
View parseSubdomain.js
export const subdomainRegex = new RegExp('^(([^.]*))', 'g')
export const parseSubdomain = hostname => (hostname || window.location.hostname).match(subdomainRegex)[0]
andreasvirkus /
Last active Aug 21, 2019
List of movies I've seen per year
* Tracking as of 28th Jan (prolly missed 5-10 movies) *
A Star Is Born
Spider-Man: Into the Spidey-verse
Immortal Machines
The Guilty
andreasvirkus / serviceWorker.js
Created Mar 10, 2019
Service worker with progressive caching
View serviceWorker.js
'use strict'
const version = 'v1::'
const offlineFundamentals = [
// ...
andreasvirkus / Dockerfile
Created Mar 10, 2019
Dockerfile for static SPAs
View Dockerfile
# build stage
FROM node:lts-alpine as build-stage
# Install git (required for @qualitista/i18n package)
RUN apk update && \
apk upgrade && \
apk add git
COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm ci && npm update @qualitista/i18n
COPY . .
View curly-bracket.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View deviceIntel.js
export const gatherDeviceIntel = () => {
const header = [
const dataos = [
{ name: 'Windows Phone', value: 'Windows Phone', version: 'OS' },
You can’t perform that action at this time.