Skip to content

Instantly share code, notes, and snippets.

View boraseoksoon's full-sized avatar
:octocat:
HQL, HLVM

장석순(Jang Seoksoon) boraseoksoon

:octocat:
HQL, HLVM
View GitHub Profile
@boraseoksoon
boraseoksoon / Device.swift
Created March 20, 2017 17:34 — forked from imkevinxu/Device.swift
iOS device checks for OS version and screen size in Swift
//
// Device.swift
// imHome
//
// Created by Kevin Xu on 2/9/15. Updated on 6/20/15.
// Copyright (c) 2015 Alpha Labs, Inc. All rights reserved.
//
import Foundation
@boraseoksoon
boraseoksoon / countries.json
Created November 11, 2018 17:24 — forked from erdem/countries.json
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@boraseoksoon
boraseoksoon / partial.swift
Created November 29, 2019 21:38 — forked from kristopherjohnson/partial.swift
Experiments with partial function application in Swift
func partial<A, B, T>(f: (A, B) -> T, a: A) -> (B) -> T {
return { f(a, $0) }
}
func bind2nd<A, B, T>(f: (A, B) -> T, b: B) -> (A) -> T {
return { f($0, b) }
}
func partial<A, B, C, T>(f: (A, B, C) -> T, a: A) -> (B, C) -> T {
@boraseoksoon
boraseoksoon / StackOverflow.py
Created November 19, 2020 13:54 — forked from ronan-mch/StackOverflow.py
This is a script for scraping the site Stack Overflow's user pages and returning relevant data from the html doc as a csv
#Stack Overflow scraper script
#imports necessary modules
from urllib2 import urlopen
from BeautifulSoup import BeautifulSoup
import time
username = raw_input("Username: ")
@boraseoksoon
boraseoksoon / hotkey_helpers.js
Created December 8, 2020 19:52 — forked from jiaaro/hotkey_helpers.js
Mac Automation – Javascript (JSX) Hotkey helpers
// How to use:
// 1. Open "Script Editor" (requires OS X 10.10 Yosemite)
// 2. Change the language from "AppleScript" to "JavaScript"
// 3. Paste the code below and replace the safari example.
//
// More info:
// https://developer.apple.com/library/mac/releasenotes/InterapplicationCommunication/RN-JavaScriptForAutomation/index.html
var sys_events = Application("System Events");
@boraseoksoon
boraseoksoon / UIViewControllerPreview.swift
Created February 11, 2021 05:38 — forked from mattt/UIViewControllerPreview.swift
Generic structures to host previews of UIView and UIViewController subclasses.
import UIKit
#if canImport(SwiftUI) && DEBUG
import SwiftUI
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
let viewController: ViewController
init(_ builder: @escaping () -> ViewController) {
viewController = builder()
}
@boraseoksoon
boraseoksoon / ConcurrentMap.swift
Created May 30, 2021 12:52 — forked from dabrahams/ConcurrentMap.swift
Concurrent Map Implementations, Benchmarked
// See commentary below this gist.
import Foundation
import QuartzCore
// Implementation from https://talk.objc.io/episodes/S01E90-concurrent-map
public final class ThreadSafe<A> {
var _value: A
let queue = DispatchQueue(label: "ThreadSafe")
init(_ value: A) { self._value = value }

Pure for guarantied value semantics

Introduction

This proposal introduces the concept of pure functions to Swift. A pure function is guarantied to allow only value semantics, even when dealing with classes.

Build Your Own LISP

I had fun building my own LISP (Slow Loris). The project was extremely easy to get off the ground, because there a ton of resources to do just this. I thought it might be handy to have a little links round-up, based on my research.

In Python

There are already several good projects out there on writing your own LISP in Python.

Peter Norvig's LisPy