Skip to content

Instantly share code, notes, and snippets.

View 1ec5's full-sized avatar
🙈
Not actively reading bugmail

Minh Nguyễn 1ec5

🙈
Not actively reading bugmail
View GitHub Profile
@1ec5
1ec5 / tiger.py
Created May 11, 2012 15:49 — forked from emacsen/pyxbot.py
OSM Tiger expansion code
#!/usr/bin/env python
"""This is the base library that can used to run various OSM bots
which are implemented as plugins"""
import sys
import os
from xml.sax.handler import ContentHandler
from xml.sax import make_parser
from xml.sax.saxutils import quoteattr
@1ec5
1ec5 / gist:a087be2078bac5aeb2ea
Created April 9, 2015 21:43
Cartographic wishlist

Some very strong cartographic traditions that are unavailable or difficult in GL:

  • Highlight a specific country with a lighter background and/or more detail
  • Simplify highway junctions into one junction point (e.g., a white diamond and no links)
  • Fill large highway interchanges with the highways’ line color
  • Duplex shields
  • Adjacent route shields for roads belonging to multiple route networks
  • Different state route shields in each state
  • County route shields
@1ec5
1ec5 / generator_config.json
Created October 28, 2015 06:39
Squirrel configuration for Open Sans Việt
# Font Squirrel Font-face Generator Configuration File
# Upload this file to the generator to recreate the settings
# you used to create these fonts.
{"mode":"expert","formats":["woff","eotz"],"tt_instructor":"default","fix_vertical_metrics":"Y","fix_gasp":"xy","add_spaces":"Y","add_hyphens":"Y","fallback":"none","fallback_custom":"100","options_subset":"advanced","subset_range":["english","ubasic","ulatin1"],"subset_custom":"\u00c0\u00e0\u00c1\u00e1\u1ea2\u1ea3\u00c3\u00e3\u1ea0\u1ea1\u00c2\u00e2\u1ea6\u1ea7\u1ea4\u1ea5\u1ea8\u1ea9\u1eaa\u1eab\u1eac\u1ead\u0102\u0103\u1eb0\u1eb1\u1eae\u1eaf\u1eb2\u1eb3\u1eb4\u1eb5\u1eb6\u1eb7\u0110\u0111\u20ab\u00c8\u00e8\u00c9\u00e9\u1eba\u1ebb\u1ebc\u1ebd\u1eb8\u1eb9\u00ca\u00ea\u1ec0\u1ec1\u1ebe\u1ebf\u1ec2\u1ec3\u1ec4\u1ec5\u1ec6\u1ec7\u00cc\u00ec\u00cd\u00ed\u1ec8\u1ec9\u0128\u0129\u1eca\u1ecb\u00d2\u00f2\u00d3\u00f3\u1ece\u1ecf\u00d5\u00f5\u1ecc\u1ecd\u00d4\u00f4\u1ed2\u1ed3\u1ed0\u1ed1\u1ed4\u1ed5\u1ed6\u1ed7\u1ed8\u1ed9\u01a0\u01a1\u1edc\u1edd\u1eda\u1edb\u1ede\u1ed
@1ec5
1ec5 / pod_versions.sh
Created January 25, 2016 19:56
CocoaPods pods by minimum deployment target
#!/usr/bin/bash
git clone https://github.com/CocoaPods/Specs.git
cd Specs/
for pod in `ls`; do
ver=$(ls $pod | sort -n | tail -n 1);
spec=$(ls $pod/$ver | head -n 1);
echo $pod/$ver/$spec >> ~/Desktop/specs.txt;
done
while read file; do
Thread 1Queue : com.apple.main-thread (serial)
#0 0x0000000183fc7f48 in __psynch_cvwait ()
#1 0x000000018408ece8 in _pthread_cond_wait ()
#2 0x0000000183a20074 in std::__1::condition_variable::wait(std::__1::unique_lock<std::__1::mutex>&) ()
#3 0x0000000183a20b40 in std::__1::__assoc_sub_state::__sub_wait(std::__1::unique_lock<std::__1::mutex>&) ()
#4 0x00000001004568a0 in std::__1::__assoc_state<bool>::move() at /Applications/Xcode+1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/future:681
#5 0x00000001004533c8 in std::__1::future<bool>::get() at /Applications/Xcode+1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/future:1168
#6 0x00000001004469d4 in bool mbgl::util::Thread<mbgl::MapContext>::invokeSync<bool, bool (mbgl::MapContext::*)(mbgl::TransformState const&, mbgl::FrameData const&), mbgl::TransformState, mbgl::FrameData>(bool (mbgl::MapContext::*)(mbgl::TransformState const&, mbgl::FrameData const&), mbgl::TransformState&&, mb
@1ec5
1ec5 / ios-v3.2.0-beta.3.podspec
Created March 31, 2016 03:57
ios-v3.2.0-beta.3
Pod::Spec.new do |m|
m.name = 'Mapbox-iOS-SDK'
m.version = '3.2.0-beta.3'
m.summary = 'Open source vector map solution for iOS with full styling capabilities.'
m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.'
m.homepage = 'https://www.mapbox.com/ios-sdk/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => 'mobile@mapbox.com' }
@1ec5
1ec5 / ServerSideSnapshot.swift
Last active January 11, 2018 14:34
Swift wrapper for Mapbox Static API
import UIKit
import CoreLocation
struct ServerSideSnapshot {
let MaximumDimension: CGFloat = 1280
var size: CGSize
var centerCoordinate: CLLocationCoordinate2D
var zoomLevel: Double
@1ec5
1ec5 / 1ec5-defaults-queue-2.podspec
Created April 19, 2016 16:13
1ec5-defaults-queue-2.podspec
Pod::Spec.new do |m|
m.name = 'Mapbox-iOS-SDK'
m.version = '3.3.0-symbols'
m.summary = 'Open source vector map solution for iOS with full styling capabilities.'
m.description = 'Open source, OpenGL-based vector map solution for iOS with full styling capabilities and Cocoa Touch APIs.'
m.homepage = 'https://www.mapbox.com/ios-sdk/'
m.license = { :type => 'BSD', :file => 'LICENSE.md' }
m.author = { 'Mapbox' => 'mobile@mapbox.com' }
@1ec5
1ec5 / DistanceFormatter.swift
Created April 25, 2016 04:10
DistanceFormatter.swift
import CoreLocation
let metersPerMile: CLLocationDistance = 1_609.344
let secondsPerHour = 60.0 * 60.0
let yardsPerMile = 1_760.0
let feetPerMile = yardsPerMile * 3.0
/// Provides appropriately formatted, localized descriptions of linear distances.
class DistanceFormatter: NSLengthFormatter {
/// True to favor brevity over precision.
@1ec5
1ec5 / Open Selection in GitHub.applescript
Last active June 21, 2016 22:36
Open Selection in GitHub
-- http://www.macosxautomation.com/applescript/sbrt/sbrt-06.html
on replace_chars(this_text, search_string, replacement_string)
set AppleScript's text item delimiters to the search_string
set the item_list to every text item of this_text
set AppleScript's text item delimiters to the replacement_string
set this_text to the item_list as string
set AppleScript's text item delimiters to ""
return this_text
end replace_chars