Skip to content

Instantly share code, notes, and snippets.

made you look

andreas andreasvirkus

made you look
View GitHub Profile
SleepWalker / swipe.js
Created Sep 30, 2015
A simple swipe detection on vanilla js
View swipe.js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
View ghost.css
* {
background: #000 !important;
color: #0f0 !important;
outline: solid #f00 1px !important;
DarrenN / get-npm-package-version
Last active Jun 8, 2021 — forked from yvele/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
reggi /
Last active Jan 13, 2021
A tutorial on how to get started using glob patterns in your terminal. #writing

Glob Up and Running

To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.

If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.

echo **/*.js
learncodeacademy / pubsub.js
Created Jul 29, 2015
Basic Javascript PubSub Pattern
View pubsub.js
//events - a super-basic Javascript (publish subscribe) pattern
var events = {
events: {},
on: function (eventName, fn) {[eventName] =[eventName] || [];[eventName].push(fn);
off: function(eventName, fn) {
if ([eventName]) {
ourmaninamsterdam / LICENSE
Last active Jun 12, 2021
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
multidis / Dockerfile
Last active May 23, 2020
Cron job scheduling inside a Docker container.
View Dockerfile
# phusion baseimage initiates cron properly
# Use phusion/baseimage as base image. To make your builds reproducible, make
# sure you lock down to a specific version, not to `latest`!
# See for
# a list of version numbers.
FROM phusion/baseimage:0.9.16
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
theodorosploumis /
Last active Apr 10, 2020
Update phpstorm on Ubuntu linux.
#!/bin/bash -e
# IMPORTANT. My phpstom installation exists on /opt/phpstorm.
# Early Access program:
# For stable releases try:
if [ "$(whoami)" != "root" ]
echo "Sorry, you are not root."
exit 1
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
NodeList.prototype.__proto__ = Array.prototype;
ianaya89 / ajax.js
Created Jan 22, 2015
Ajax request with Vanilla JS
View ajax.js
function ajax(type, url) {
var request = new XMLHttpRequest();, url, true);
request.onload = function() {
if (this.status >= 200 && this.status < 400) {
var resp = this.response;
else {