Skip to content

Instantly share code, notes, and snippets.

View martinvirtel's full-sized avatar

Martin Virtel martinvirtel

View GitHub Profile
@martinvirtel
martinvirtel / chrome-refresh.sh
Last active November 23, 2016 07:01
Chrome Refresh on File Change
#!/bin/bash
#
# Watches the folder or files passed as arguments to the script and when it
# detects a change it automatically refreshes Chrome tab or
# window.
#
# Inspired by: http://razius.com/articles/auto-refreshing-google-chrome-on-file-changes/
#
# Usage:
# ./chrome-refresh.sh /folder/to/watch /some/folder/file_to_watch.html
@martinvirtel
martinvirtel / Makefile
Last active July 20, 2017 18:22
Fabulous VPN Makefile
me := $(shell whoami)
aws-config := --profile=odc
ssh-config := -i /home/martin/.ssh/id_martinvirtel_server_2016
SHELL := /bin/bash
DB := feedback
# Look for variables in fish universal environment
#ifndef bastion
# bastion := $(shell fish -c "echo \$$bastion")
@martinvirtel
martinvirtel / iframe.html
Last active June 27, 2016 15:57
iframe height
<html>
<head>
<script src="https://code.jquery.com/jquery-3.0.0.min.js"></script>
</head>
<body>
<div id="outer" style="height:100px; border: 1px solid red; overflow: auto;">
<div id="inner" style="height:10000px;">
scroll me tender again!

Using AWS S3 logging to gather metrics

This repo contains a terraform file and a single-pixel transparent gif. You can use it to get approximate cookie-less usage metrics out of any web application that refernces the publicly exposed pixel.gif.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@martinvirtel
martinvirtel / dpaify.js
Created May 17, 2016 06:53
Wikimedia against capital D
/* http://stackoverflow.com/questions/10730309/find-all-text-nodes-in-html-page */
function textNodesUnder(el){
var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
while(n=walk.nextNode()) a.push(n);
return a;
}
f=textNodesUnder(document);
@martinvirtel
martinvirtel / readme.md
Last active May 4, 2016 11:14
Nasa NEX GDDP visualization prototype

June 27th, 2040. Summer is coming. View interactive.

What is this?

The map shows maximum temperatures for a random day in the summer of 2040, based on the MIROC-ESM climate model as calculated by the NASA NEX GDDP project. See here for the fascinating details: https://nex.nasa.gov/nex/projects/1356/

Data set as GeoJSON and TopoJSON can be found here:

@martinvirtel
martinvirtel / world-panzoom.json
Created April 30, 2016 20:32
Vega Spec: Pan and Zoom map with the mouse
{
"parameters": [
],
"spec": {
"width": 740,
"height": 500,
"padding": 0,
"signals" : [
{
"name": "point",
.PHONY: update-renew-order
all :
@echo Please select a specific target
update-renew-order :
ifdef DB_PASSWORD
mysql --user=$(DB_USER) --password=$(DB_PASSWORD) $(DB_DATABASE) <renew_order.sql
else
$(info Please source ../reports/.credentials to define DB_PASSWORD etc)
@martinvirtel
martinvirtel / README.md
Last active April 11, 2018 13:49
Embed Frame Test

Basic HTML for iframe testing

URL Paramters:

As <iframe> attributes:

  • src
  • allowfullscreen
  • width
  • height
  • scrolling