Skip to content

Instantly share code, notes, and snippets.

View burg's full-sized avatar

Blaze Jayne burg

View GitHub Profile
@sprhawk
sprhawk / gist:2779208
Created May 24, 2012 03:06
git diff localizable.strings
(from :http://www.entropy.ch/blog/Developer/2010/04/15/Git-diff-for-Localizable-strings-Files.html)
First, add this to the project’s .git/info/attributes file:
+
*.strings diff=localizablestrings
(Unfortunately you do have to add it to every project, there doesn’t seem to be a global attributes configuration file)
Second, add this to your ~/.gitconfig file:
@mbostock
mbostock / .block
Last active October 27, 2016 18:09
Custom Projection
license: gpl-3.0
height: 800
@mbostock
mbostock / .block
Last active October 27, 2016 18:07
Custom Cartesian Projection
license: gpl-3.0
"""
This file contains code that, when run on Python 2.7.5 or earlier, creates
a string that should not exist: u'\Udeadbeef'. That's a single "character"
that's illegal in Python because it's outside the valid Unicode range.
It then uses it to crash various things in the Python standard library and
corrupt a database.
On Python 3... well, this file is full of syntax errors on Python 3. But
if you were to change the print statements and byte literals and stuff:
@mbostock
mbostock / .block
Last active November 20, 2016 23:20
Dynamic Simplification IV
license: gpl-3.0
@nitaku
nitaku / README.md
Last active May 10, 2024 22:47
Sky

A map of the sky that uses an azimuthal equidistant projection with star data. Longitudes and latitudes for the geo projection are obtained from declination and right ascension respectively (longitude is also inverted, because, unlike the earth globe, the celestial sphere is seen from the inside).

The boreal (northern) sky is shown at left, while the austral (southern) at right. Because right ascension is given in hours, both maps are divided in 24 slices. A circle is shown every 10 degrees of declination.

Star size indicates magnitude. Bigger circles depict brighter stars.

@jasondavies
jasondavies / README.md
Last active October 29, 2018 11:08 — forked from monsieurBelbo/caba.json
Areas of Clipped Voronoi Regions

A demonstration of how to calculate the areas of Voronoi regions clipped by geographic features using D3.

[D3’s implementation](Sutherland–Hodgman algorithm) of the Sutherland–Hodgman algorithm only works for convex clip polygons, but we exploit the fact that Voronoi regions are guaranteed to be convex, and use each Voronoi region as a clip polygon, with the projected geographic boundary as a subject polygon.

In response to a question by Gonzalo Bellver.

@scriptingosx
scriptingosx / create_netloc.py
Last active March 5, 2023 03:09
Create OS X inetloc files
#!/usr/bin/python
import sys
import argparse
import urlparse
import urllib
import plistlib
import os.path
import subprocess
@floatplane
floatplane / .lldbinit
Created May 7, 2015 17:05
Sample .lldbinit
# This file contains commands that LLDB will execute at startup. Drop it in your
# home directory: ~/.lldbinit
# Dump the UIKit view hierarchy
command regex rd 's/[[:space:]]*$/po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]/' 's/.+$/po [%1 recursiveDescription]/'
# Try not to step into uninteresting library code. Needs some work.
settings set target.process.thread.step-avoid-regexp ^(std::(!function)|boost::shared_ptr)
# https://github.com/facebook/chisel
@FriendlyTester
FriendlyTester / LogSounds.sh
Last active July 2, 2021 08:37
Shell Script To Play Sounds On Word Match
tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done
#log.txt this is the log file you want to tail. Full path if not in that directory
#'ERROR' is the stirng you are looking to match
#beep-01a.wav is the sound to play when string matched. Full path if not in that directory
#Maik later responded saying his logfile was on a remote server, he discovered the following worked to tail a remote file
ssh <user@remoteserver> tail -n 0 -f log.txt | grep --line-buffered 'ERROR' | while read line; do afplay beep-01a.wav; done