Skip to content

Instantly share code, notes, and snippets.

View mxfh's full-sized avatar

Friedrich Hartmann mxfh

View GitHub Profile
@veltman
veltman / README.md
Last active October 28, 2019 10:45
Strip map

Version with labels

Creating an automatic strip map based on some geographic features and a chosen "spine." The approximate steps:

  1. Pick a LineString (e.g. the California coast) to straighten out.
  2. Simplify that LineString.
  3. Turn that simplified LineString into a set of zones, one per segment.
  4. Rotate/translate each zone to its destination position, anchoring it to the end of the previous segment and rotating it to match the desired angle (e.g. horizontal).
  5. Warp the contents of each zone to the resulting rectangle with a bilinear warp.
@alfredopalhares
alfredopalhares / gist:d475257c84410c7fcca6
Last active February 15, 2024 12:15
Restoring a PDF file from chrome cache

So I was trying to do my duties as a good civilian by paying taxes of stuff you already own.

In this particular case it meant going to the website and try and generate a PDF document that would allow me to pay for said stuff. After 2 unsuccessful attempts to generate the PDF (got greeted by 500s), I finally got the PDF open on chromium (using the PDF preview) and trying to save, the browser crashed..

I then quickly reboot chromium and tried to generate the PDF again, only to find out that I can't, the website only allows you to generate the document and download once, this is a critical document used as prof and means to pay your taxes. It doesn't really make much sense that you only can download it once, but such is the way of life.

I've been suffering from this bug for quite a while, but it never affected me in this way.

The file wasn't on ~/Downloads, so I've tried browsing chrome://cache and after a while I found the PDF HTTP request, w

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active May 19, 2024 17:37
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@ZJONSSON
ZJONSSON / index.html
Created June 20, 2012 01:21
D3 + Leaflet (fork mbostock)
<!DOCTYPE html>
<title>D3 + Leaflet (fork from bost.ocks.org/mike/leaflet/)</title>
<style>
#map { width: 960px; height: 500px;}
path { fill: #000; fill-opacity: .2; stroke: #fff; stroke-width: 1.5px;}
path:hover { fill: brown;fill-opacity: .7;}
</style>
<p id="map"><p>
<script src="http://d3js.org/d3.v2.min.js?2.9.3"></script>
<script src="leaflet.js"></script>
@gre
gre / easing.js
Last active May 17, 2024 03:33
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {