Skip to content

Instantly share code, notes, and snippets.

View rbanick's full-sized avatar

Robert Banick rbanick

  • Arbol
  • Ciudad de México, México
View GitHub Profile
@rbanick
rbanick / manually_rollback_homebrew.md
Last active August 25, 2020 23:21
How to manually roll back homebrew formula on a UNIX platform

Rolling back Homebrew formula on a UNIX platform

The problem

Sometimes brew updates break your computer or a piece of software. This is usually really unpleasant as it can take some time to diagnose which formula at which version did so. Even if you can diagnose, it's not very clear how to roll back homebrew softwares to previous versions.

How to fix it

@rbanick
rbanick / building_a_swipe.markdown
Created June 4, 2015 20:45
Building an OSM Before-After Swiper

Building swipers from the Guinea-swipe code

Making the maps

To be filled in!

Cleaning up the code

Github

@rbanick
rbanick / Convert_pbf_to_obf.md
Last active May 17, 2019 18:48
Creating custom OBF files for OsmAnd
@rbanick
rbanick / flatten_atlas.sh
Last active August 29, 2015 14:21
Quickly flattening an atlas of vector PDFs
#!/bin/bash
# This will convert PDF atlases to .pngs and then convert them back to .PDF, now rasterized.
# Use this script to flatten PDF exports from QGIS so you can generate thumbnails for the Mapfolio
# This script uses imagemagick and ghostscript.
# Please note: Ghostscript does not automatically come installed with imagemagick. Run 'brew install gs' to install it.
## Atlas Conversion
@rbanick
rbanick / thumbnails.sh
Last active July 15, 2018 13:28
Create thumbnails for a bunch of PDFs
#!/bin/bash
# This will convert PDF atlases to .pngs and then convert them back to .PDF, now rasterized.
# Use this script to flatten PDF exports from QGIS so you can generate thumbnails for the Mapfolio
### DEPENDENCIES
# This script uses parallel, imagemagick and ghostscript.
# To install: brew install imagemagick && brew install parallel && brew install gs
# Please note: Ghostscript does not automatically come installed with imagemagick.
@rbanick
rbanick / Replace accented characters.vba
Created April 20, 2015 20:55
Macro to replace accented characters in Excel
Private Function CheckStringCHAR(InString) As String
' CheckStringCHAR(InString)
' Returns its passed agrument, but with exchanged European? characters
' Function created 7/08/2003 by Stanley D. Grom, Jr.
'
CheckStringCHAR = ""
StringLength = Len(InString)
For i = 1 To StringLength
@rbanick
rbanick / SoS_Charts.md
Created March 25, 2015 00:27
SoS Charts Instructions

Formatting the SoS Charts

Background

Make sure you have installed Helvetica Neue.

Tableau

Someone foolishly used a file geodatabase? No problem. Get that data out at GDB Flee: https://gdbflee-mweisman.rhcloud.com/
@rbanick
rbanick / Creating Hillshades in QGIS
Last active January 22, 2018 22:23
Creating Hillshades in QGIS
QGIS Hillshades are not hard, but they're often a little screwy. That's because units of measurement for elevation and x/y are often different. So, for instance, your DEM may be projected in WGS84 and hence have decimal degree units. But the DEM elevation units are often in meters. You need to account for this in the "scale" setting of QGIS.
The basic rule of thumb is this:
If everything is in meters, use scale factor 1.0 (default).
If x/y is in degree and z in meters, use scale factor 111120.
If x/y degree and z is feet, use scale factor 370400.
So, in QGIS 2.6, go to Raster --> Analysis --> DEM (Terrain Modules)
Load up your data, name the new file, and leave all the settings the same EXCEPT for scale. In most cases (SRTM data) you'll then rename scale to 111120.
@rbanick
rbanick / Fixing Postgres Links
Last active August 29, 2015 14:11
Fixing Postgres: Useful Links