This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DLFonts.swift | |
// | |
// Created by Hirohito Kato on 2017/04/21. | |
// Copyright © 2017 Hirohito Kato. All rights reserved. | |
// | |
// | |
// FontDownloader.swift | |
// FontDownloader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ヒュベニの距離計算式を使用して、2点({latitude1,longitude1}, {latitude2,longitude2})間の | |
* 距離を求める。測地系にはWGS84を使用。 | |
* | |
* 参考: | |
* - ヒュベニの距離計算式の簡略式( http://www.kashmir3d.com/kash/manual/std_siki.htm ) | |
* - 正式な公式は http://www.amano-tec.com/apps/paceruler.html を参照 | |
*/ | |
function calculateDistance(latitude1, longitude1, latitude2, longitude2) { | |
// 先に計算しておいた定数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
prefix operator * | |
infix operator <- | |
class Wrapper<T> { | |
var value: T | |
init(_ v: T) { value = v } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// XCSourceEditorCommand.h | |
// Xcode | |
// | |
// Copyright © 2016 Apple Inc. All rights reserved. | |
// | |
#import <XcodeKit/XcodeKitDefines.h> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @ref: https://www.bluetooth.com/specifications/gatt/services?sc_lang=en | |
for i in 0..<0xFFFF { | |
let uuid = CBUUID(string: String(format: "0x%.04X", i)) | |
if !"\(uuid)".contains("Unknown") { | |
print("\(String(format: "0x%.04X", i)) : \(uuid)") | |
} | |
} | |
/* Result | |
0x1800 : Generic Access Profile | |
0x1801 : Generic Attribute Profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -see: http://stackoverflow.com/a/16356147 | |
extension UITextField { | |
private struct AssociatedKeys { | |
static var origFontSize:NSObject? | |
} | |
var autoShrinkText: String? { | |
get { return text } | |
set { | |
guard let font = font else { text = newValue; return } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# coding: utf-8 | |
import sys, os, time | |
import re | |
EMOJI = { | |
":bug:" :"🐛", # バグ修正 | |
":+1:" :"👍", # 機能改善 | |
":sparkles:" :"✨", # 部分的な機能追加 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// merged from https://gist.github.com/norio-nomura/fdbf22dacefcfcf87705cf2cd8fb846f | |
import Foundation | |
public protocol ArithmeticType: IntegerLiteralConvertible { | |
func +(lhs: Self, rhs: Self) -> Self | |
func -(lhs: Self, rhs: Self) -> Self | |
func *(lhs: Self, rhs: Self) -> Self | |
func /(lhs: Self, rhs: Self) -> Self | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import Foundation | |
typealias Byte = UInt8 | |
protocol GenericIntegerType: IntegerType { | |
init(_ v: Int) | |
init(_ v: UInt) | |
init(_ v: Int8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shell script for building Boost C++ for iOS (armv7, armv7s, arm64), the iOS Simulator | |
# (i386, x86_64), and Mac OSX (i386, x86_64). | |
# | |
# Creates a set of universal libraries and a pseudo-framework to facilitate using | |
# Boost C++ in Xcode. | |
# | |
# To configure the script, define: | |
# | |
# BOOST_VERSION Boost C++ version (e.g. 1.57.0) | |
# BOOST_LIBS: which Boost C++ libraries to build |