Skip to content

Instantly share code, notes, and snippets.

View SuperShinyEyes's full-sized avatar

Seyoung Park SuperShinyEyes

View GitHub Profile
{
"type": "FeatureCollection",
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
"features": [
{ "type": "Feature", "properties": { "id": 4217316, "building": null, "addr:street": null, "addr:housenumber": null, "source": null, "addr:postcode": null, "building:levels": null, "indoor": null }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 24.8357854, 60.1861117 ], [ 24.8358029, 60.1860362 ], [ 24.8358435, 60.1853441 ], [ 24.8358207, 60.1852371 ], [ 24.8357668, 60.1851577 ], [ 24.8356747, 60.1850789 ], [ 24.8355678, 60.1850187 ], [ 24.8354319, 60.1849665 ], [ 24.8352678, 60.1849266 ], [ 24.8350982, 60.184905 ], [ 24.834877, 60.1849023 ], [ 24.8346919, 60.1849219 ], [ 24.83451, 60.1849637 ], [ 24.8343535, 60.1850241 ], [ 24.834236, 60.1850946 ], [ 24.8341625, 60.1851615 ], [ 24.8341123, 60.1852366 ], [ 24.8340893, 60.1853272 ], [ 24.8340695, 60.1860134 ], [ 24.8340962, 60.1861315 ], [ 24.8
@SuperShinyEyes
SuperShinyEyes / [geojson]polygon with a hole
Created July 21, 2016 15:14
Mapbox iOS SDK 3.2.3 draws a polygon with its hole filled.
{
"type": "FeatureCollection",
"features": [{
"type": "Feature",
"properties": {
"stroke": "#555555",
"stroke-width": 2,
"stroke-opacity": 1,
"fill": "#555555",
"fill-opacity": 0.5,
@SuperShinyEyes
SuperShinyEyes / download_JPG_from_strings.py
Last active February 1, 2017 06:37
Download JPGs by reading a file of image URLs.
#!/usr/bin/env Python3
import requests
PATH_PREFIX = ""
FILE = "imageNames"
def downloadImage(url):
'''
Reference:
http://stackoverflow.com/questions/13137817/how-to-download-image-using-requests
@SuperShinyEyes
SuperShinyEyes / git.plugin.zsh
Last active October 23, 2017 14:45
git config for zsh
# .oh-my-zsh/plugins/git/git.plugin.zsh
# Query/use custom command for `git`.
zstyle -s ":vcs_info:git:*:-all-" "command" _omz_git_git_cmd
: ${_omz_git_git_cmd:=git}
#
# Functions
#
# The name of the current branch
@SuperShinyEyes
SuperShinyEyes / UIButton.swift
Created August 16, 2017 08:30
Create UIButton programmatically swift
//
// MainView.swift
// SeyoungARBasic
//
// Created by YOUNG on 16/08/2017.
// Copyright © 2017 YOUNG. All rights reserved.
//
import UIKit
@SuperShinyEyes
SuperShinyEyes / subclassOfUIView.swift
Created August 16, 2017 08:31
Subclassing UIView swift
class MyView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
addBehavior()
}
convenience init() {
self.init(frame: CGRect.zero)
}
@SuperShinyEyes
SuperShinyEyes / ScenekitBarebone.swift
Created August 18, 2017 06:54
iOS 10 scenekit barebone
//
// GameViewController.swift
// Breaker
//
// Created by YOUNG on 18/08/2017.
// Copyright © 2017 YOUNG. All rights reserved.
//
import UIKit
import SceneKit
@SuperShinyEyes
SuperShinyEyes / UIAlertBarebone.swift
Created August 29, 2017 07:16
UIAlertViewController Barebone
@IBAction func showAlert(_ sender: UIButton) {
let alert = UIAlertController(title: "Hello", message: "Ca va?", preferredStyle: .alert)
let action = UIAlertAction(title: "Awesome", style: .default, handler: nil)
alert.addAction(action)
present(alert, animated: true)
}
@SuperShinyEyes
SuperShinyEyes / RandomInteger.swift
Last active August 29, 2017 07:44
An arbitrary integer (whole number) 0 <= x < 100
/// an arbitrary integer (whole number) between 0 and 100.
Int(arc4random_uniform(100))
@SuperShinyEyes
SuperShinyEyes / localRealmTableView.swift
Created August 30, 2017 09:11
Save&Load Data locally in a persistent way using Realm
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.main.bounds)
window?.rootViewController = UINavigationController(rootViewController: ViewController(style:.plain))