Skip to content

Instantly share code, notes, and snippets.

@cartazio
cartazio / xcode5-haskell-directions.md
Last active November 17, 2025 00:31
xcode 5 + OS X 10.9 mavericks GHC work around nuttiness

PSA :

just use GHC for OSX https://ghcformacosx.github.io

the rest of these directions are preserved for historical purposes

TLDR version, if you have homebrew

xcode-select --install ; brew tap homebrew/versions ;   brew tap homebrew/dupes \
@jpetazzo
jpetazzo / README.md
Last active December 13, 2024 03:44
Manual custom geocoding using OSM database

Someone asked how to get the latlong from a specific road near a town on OpenStreetMap.

If you need to do it only once (e.g., you're about to go on a trip, and your GPS cannot find your destination city, but allows you to enter GPS coordinates), you can use Nominatim, OpenStreetMap's geocoding interface.

If you need to do it multiple times, in a programmatic manner, there are at least two ways to do that.

Note: I worked with OSM data a couple of years ago, but I don't have an OSM database on my local laptop right now, so some instructions will be a bit fuzzy. I do apologize in advance.

PostGIS queries on a local OSM DB

@holograph
holograph / ChainedEnumSerializer.scala
Created December 18, 2012 15:22
A workaround for the Lift-JSON bug documented here: https://github.com/lift/framework/issues/1080 Basically works by providing a single serializer for multiple enumerations, the order of which determines behavior in case of value collisions. Forked from a gist I accidentally created anonymously.
package com.tomergabel.examples
import net.liftweb.json._
import net.liftweb.json.JsonDSL._
/**
* A chained object which provides JSON serialization/deserialization facilities for multiple enumerations.
* Intended as a workaround for the following issue: https://github.com/lift/framework/issues/1080
*
* To use simply add to your formats: `implicit val formats = DefaultFormats + new ChainedEnumSerializer( enum1, enum2 )`
@aratak
aratak / 500.js
Created August 10, 2012 08:13
ajax exceptions
$.ajaxSetup
statusCode:
401: -> $.pub('flash:show', text: "You have been logged out. Please, <a href='javascript:window.location.reload()'><span class='icon'>X</span>refresh</a> the page", type: 'warning', hide: false)
404: -> $.pub('flash:show', text: "Page not found", type: 'warning', hide: false)
500: -> $.pub('flash:show', text: "Oops! Something went wrong.", type: 'warning', hide: false)
error: -> $.pub('flash:show', text: "Can't connect to the server. Please, check your internet connection.", type: 'warning', hide: false)
timeout: -> $.pub('flash:show', text: "Server is not response. Please, <a href='http://turbinehq.com/contact/'>report about that to us</a>.", type: 'warning', hide: false)
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2: