Skip to content

Instantly share code, notes, and snippets.

View inactivist's full-sized avatar
💭
fixing things

Michael Curry inactivist

💭
fixing things
View GitHub Profile
@tmcw
tmcw / xyz_vs_tms.md
Last active February 11, 2026 06:42
The difference between XYZ and TMS tiles and how to convert between them

The difference between XYZ and TMS tiles and how to convert between them

Lots of tile-based maps use either the XYZ or TMS scheme. These are the maps that have tiles ending in /0/0/0.png or something. Sometimes if it's a script, it'll look like &z=0&y=0&x=0 instead. Anyway, these are usually maps in Spherical Mercator.

Good examples are OpenStreetMap, Google Maps, MapBox, MapQuest, etc. Lots of maps.

Most of those are in XYZ. The best documentation for that is slippy map tilenames on the OSM Wiki, and Klokan's Tiles a la Google.

@jshaw
jshaw / byobuCommands
Last active July 21, 2026 08:31
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@jarobins
jarobins / gplus_ttopten.py
Last active February 22, 2018 13:11
Access Google+ trends using urllib2. Displays the top ten trends and updates every minute.
import urllib2, re, time
from Tkinter import *
class App:
def __init__(self, master):
self.master = master
frame = Frame(master)
frame.pack()
@cbednarski
cbednarski / balsamiq-installer.sh
Last active December 16, 2015 04:49
Install script for Balsamiq Mockups on Ubuntu 12.04.2
#!/usr/bin/env bash
if [ $EUID != 0 ]; then
"This script must be run with sudo"
exit $?
fi
echo " Installing dependencies"
apt-get install ia32-libs -y # Note: This dep is a bit overkill but it's useful anyway
ln -s /usr/lib/i386-linux-gnu/libgnome-keyring.so.0 /usr/lib/libgnome-keyring.so.0
import json
from shapely.geometry.base import BaseGeometry
from shapely.geometry import shape, mapping
class ShapelyEncoder(json.JSONEncoder):
def default(self, obj):
if isinstance(obj, BaseGeometry):
return mapping(obj)
return json.JSONEncoder.default(self, obj)
# coding=UTF-8
import nltk
from nltk.corpus import brown
# This is a fast and simple noun phrase extractor (based on NLTK)
# Feel free to use it, just keep a link back to this post
# http://thetokenizer.com/2013/05/09/efficient-way-to-extract-the-main-topics-of-a-sentence/
# Create by Shlomi Babluki
# May, 2013
@mity
mity / hsv.c
Created July 18, 2013 23:38
RGB <--> HSV color conversion functions for Windows, in integer arithmetics.
/*
* RGB <--> HSV conversion in integer arithmetics, to be used on Windows.
* Copyright (c) 2013 Martin Mitas
*
* 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:
@brandonhamric
brandonhamric / InstallRedisOnUbuntu.markdown
Last active December 20, 2015 01:09
Installing Redis on Ubuntu 12.04

Installing Redis on Ubuntu 12.04

Introduction

This is a quick guide to setting up the latest redis version on Ubuntu 12.04. I'm actually working on an Ubuntu 12.04 64 bit Amazon EC2 instance (ami-dof89fb0), but this should work on most Ubuntu and Linux flavors.

Dependencies

Redis doesn't have many dependencies, just Make, gcc, and TCL:

@hubgit
hubgit / README.md
Last active July 15, 2026 15:56
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files

@mathiasbynens
mathiasbynens / .gitignore
Last active August 7, 2024 02:26
Generating a regular expression to match valid JavaScript identifiers (like https://mathiasbynens.be/demo/javascript-identifier-regex) in Node.js
package-lock.json
node_modules