This file contains hidden or 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 FloatingPanel | |
import SwiftUI | |
extension View { | |
public func floatingPanel() -> some View { | |
FloatingPanelView(parent: { self }) | |
.ignoresSafeArea() | |
} | |
} |
This file contains hidden or 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
struct WiFi { | |
static func localWiFiIPAddress() -> String? { | |
var ret: String? | |
var addr: UnsafeMutablePointer<ifaddrs>? | |
guard getifaddrs(&addr) == 0 else { return nil } | |
guard let cursor = addr else { return nil } | |
for cur in sequence(first: cursor, next: { $0.pointee.ifa_next }) { |
This file contains hidden or 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
// | |
// WobblingEffect.swift | |
// | |
import UIKit | |
protocol WobblingEffect { | |
var wobbling: Bool { get set } | |
func startWobbling() | |
func stopWobbling() |
This file contains hidden or 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
#include <pthread.h> | |
#include <mach/mach.h> | |
/** | |
* @return -1 on error, else the number of threads for the current process | |
*/ | |
static int currentThreadCount() | |
{ | |
thread_act_array_t threads; | |
mach_msg_type_number_t thread_count = 0; |
This file contains hidden or 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
// | |
// Copyright © 2016 SCENEE. All rights reserved. | |
// | |
import Foundation | |
class KVObserver<Target, Value where Target: NSObject>: NSObject { | |
typealias blockType = ((Value) -> ()) | |
let target: Target | |
let keyPath: String |
This file contains hidden or 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
#!/bin/bash -eu | |
############################# | |
# build.sh | |
# Created by Shin Yamamoto | |
# | |
# Usage: | |
# $./build.sh [PROVISIONING_PROFILE_PATH] | |
# | |
############################# |