Skip to content

Instantly share code, notes, and snippets.

View martinvirtel's full-sized avatar

Martin Virtel martinvirtel

View GitHub Profile
@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",
@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 / 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);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

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.

@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!
@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 / README.md
Last active January 27, 2017 14:46
Wordpress + Apache: Extend lifetime of login cookies

Wordpress + Apache: Extend Cookie Lifetime

In standard Wordpress, your login will be saved for 48 hours, or 14 days if you click "remember me" on login. This configuration snippet allows you to extend that time to 30 days.

For this to work, your Wordpress has to live inside an Apache server, and the apache server has to have mod_headers activated. Then, include the file extend_wordpress_cookie_lifetime.conf into the configuration of your Apache server using the Include directive.

@martinvirtel
martinvirtel / .gitignore
Last active January 27, 2017 16:37
Custom Analysis of Cookie Log
data/
rawdata/
@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")