Skip to content

Instantly share code, notes, and snippets.

View treastrain's full-sized avatar
🏠
Learning at home

treastrain / Tanaka Ryoga treastrain

🏠
Learning at home
View GitHub Profile
@treastrain
treastrain / AuthenticationByTouchIDWithMacOSCommandLineTool.swift
Created March 26, 2021 09:59
macOS Command Line Tool で Local Authentication を使って MacBook Pro の Touch ID で認証する Swift プログラム
//
// AuthenticationByTouchIDWithMacOSCommandLineTool.swift
//
//
// Created by treastrain on 2021/03/26.
//
import LocalAuthentication
let context = LAContext()
@treastrain
treastrain / Task :shared:linkDebugFrameworkIosArm64 FAILED
Last active March 20, 2021 09:54
Task :shared:linkDebugFrameworkIosArm64 FAILED
Command line invocation:
/Applications/Xcode-12.5.0-Beta.3.app/Contents/Developer/usr/bin/xcodebuild -project /Users/treastrain/AndroidStudioProjects/MyKMMApplication/./iosApp/iosApp.xcodeproj -scheme iosApp OBJROOT=/Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios SYMROOT=/Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios -sdk iphoneos -arch arm64
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Build settings from command line:
ARCHS = arm64
OBJROOT = /Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios
SDKROOT = iphoneos14.5
@treastrain
treastrain / Task :shared:linkDebugFrameworkIosX64 FAILED
Last active March 20, 2021 13:35
Task :shared:linkDebugFrameworkIosX64 FAILED
Command line invocation:
/Applications/Xcode-12.5.0-Beta.3.app/Contents/Developer/usr/bin/xcodebuild -project /Users/treastrain/AndroidStudioProjects/MyKMMApplication/./iosApp/iosApp.xcodeproj -scheme iosApp OBJROOT=/Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios SYMROOT=/Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios -sdk iphoneos -arch arm64
User defaults from command line:
IDEPackageSupportUseBuiltinSCM = YES
Build settings from command line:
ARCHS = arm64
OBJROOT = /Users/treastrain/AndroidStudioProjects/MyKMMApplication/build/ios
SDKROOT = iphoneos14.5
@treastrain
treastrain / ContentView.swift
Last active March 3, 2021 08:15
【SwiftUI & Kronos】NTP から時刻を取得し端末の設定によらず正しい Date を得る
//
// ContentView.swift
// Shared
//
// Created by treastrain on 2021/03/03.
//
import SwiftUI
import Kronos
@treastrain
treastrain / Makefile
Last active June 14, 2023 11:59
✅ A C++ project using OpenCV that can be compiled with Clang but not with GCC
OpenCV-Playground:
echo OpenCV-Playground
buildclang:
clang++ -Wall -std=c++17 -O0 \
-I../Libraries/opencv/include/opencv4 -L../Libraries/opencv/lib \
-lopencv_core -lopencv_videoio -lopencv_imgproc -lopencv_imgcodecs \
-o OpenCV-Playground \
main.cpp
@treastrain
treastrain / main.cpp
Created January 14, 2021 10:07
コンパイラ・C++ 標準の判定
#include <iostream>
int main(int, char**) {
#if __cplusplus > 199711L
system("uname -a");
#endif
// コンパイラの判定
#ifdef __clang_version__
@treastrain
treastrain / gist:fa9b507b3a66ed578108b8a6c5330a0d
Created December 25, 2020 16:21
Raspberry Pi 4 Model B (armv7l) で Swift コンパイラのビルドを試しているが、「swift/stdlib/public/core/KeyPath.swift」でコケているように見える
$ date; ./swift/utils/build-script --release; date
2020年 12月 26日 土曜日 00:54:58 JST
[./swift/utils/build-script] NOTE: Using toolchain default
+ cmake --version
+ mkdir -p /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert
Building the standard library for: swift-test-stdlib-linux-armv7
+ /usr/local/bin/cmake --build /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/cmark-linux-armv7 -- -j4 all
ninja: no work to do.
symlinking the system headers (/usr/include/c++) into the local clang build directory (/home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/llvm-linux-armv7/include).
+ ln -s -f /usr/include/c++ /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/llvm-linux-armv7/include
@treastrain
treastrain / gist:53ca52112bbc17aa90c234590179a819
Created December 25, 2020 11:01
Raspberry Pi 4 Model B (armv7l) で Swift コンパイラのビルドを試しているが、ICU が見つからないと言われてしまう
treastrain@raspberrypi:~/Developer/Libraries/swift-source $ date; ./swift/utils/build-script --release; date
2020年 12月 25日 金曜日 19:38:22 JST
[./swift/utils/build-script] NOTE: Using toolchain default
+ cmake --version
+ mkdir -p /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert
Building the standard library for: swift-test-stdlib-linux-armv7
+ /usr/local/bin/cmake --build /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/cmark-linux-armv7 -- -j4 all
ninja: no work to do.
symlinking the system headers (/usr/include/c++) into the local clang build directory (/home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/llvm-linux-armv7/include).
+ ln -s -f /usr/include/c++ /home/treastrain/Developer/Libraries/swift-source/build/Ninja-ReleaseAssert/llvm-linux-armv7/include
@treastrain
treastrain / project.yml
Last active March 3, 2025 09:28
Japan NFC Reader の XcodeGen project.yml (ビルド 2020110801 時点)
attributes:
ORGANIZATIONNAME: treastrain / Tanaka Ryoga
name: JapanNFCReader
configs:
Debug: debug
Release: release
settings:
@treastrain
treastrain / c_cpp_properties.json
Created October 27, 2020 10:42
Visual Studio Code から SSH 接続した Raspberry Pi 4 Model B で OpenCV を含む C++ プロジェクトを作成した際の各 json ファイル
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/usr/local/include/opencv4"
],
"defines": [],
"compilerPath": "/usr/bin/clang",