Skip to content

Instantly share code, notes, and snippets.

View dealforest's full-sized avatar

Toshihiro Morimoto dealforest

View GitHub Profile
@dealforest
dealforest / MnistImageType.swift
Last active January 14, 2020 03:33
the model automatically generated from mlmodel
//
// MnistImageType.swift
//
// This file was automatically generated and should not be edited.
//
import CoreML
/// Model Prediction Input Type
@dealforest
dealforest / slack.py
Last active January 24, 2018 01:53
send to slack in LLDB
#!/usr/bin/env python
import lldb
def slack(debugger, command, result, internal_dict):
frame = lldb.debugger.GetSelectedTarget().GetProcess().GetSelectedThread().GetSelectedFrame()
path = command
lldb.debugger.HandleCommand("""
expr -l swift --
#!/bin/bash -eu
temp_dir=`mktemp --directory`
target_dir=/Applications/Xcode-beta.app/Contents/MacOS
if [ -e $target_dir/Xcode.signed ]; then
echo "already exists Xcode.signed"
exit 1
fi
@dealforest
dealforest / gist:edde2632c644c3dc9d04
Last active August 29, 2015 14:25
only Swfit 1.2
let request = GitHub.Endpoint.SearchRepositories(query: "APIKit", sort: .Stars)
GitHub.sendRequest(request)
.success { println($0) }
.failure { println($0) }
extension GitHub {
func sendRequest<T: APIKit.Request>(request: T) -> Task<Float, T.Response, NSError> {
return Task { progress, fulfill, reject, configure in
/*
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1
@dealforest
dealforest / O0
Last active August 29, 2015 14:10
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) Target: x86_64-apple-darwin13.4.0 Thread model: posix
Pass Arguments: -targetlibinfo -datalayout -verify -verify-di
Target Library Information
Data Layout
ModulePass Manager
FunctionPass Manager
Module Verifier
Debug Info Verifier
Bitcode Writer
@dealforest
dealforest / gist:c50667424376c09383a9
Last active August 29, 2015 14:08
check Xcode version
# http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format/4025065#4025065
# 0: =, 1: >, 2: <
vercomp () {
if [[ $1 == $2 ]]
then
return 0
fi
local IFS=.
local i ver1=($1) ver2=($2)
# fill empty fields in ver1 with zeros
Incident Identifier: 4443D885-3C0C-4582-86BA-C2FC85F9FAC5
CrashReporter Key: 08e4571debddd2c404663681d874fc364222a762
Hardware Model: iPhone5,2
Process: JPKB [255]
Path: /private/var/mobile/Containers/Bundle/Application/E5B12325-F84A-4BF9-9DF0-24BEE46A7DCB/JapaneseKeyboardKit.app/PlugIns/JPKB.appex/JPKB
Identifier: com.kishikawakatsumi.JapaneseKeyboardKit.JPKB
Version: 1 (1.0)
Code Type: ARM (Native)
Parent Process: launchd [1]
@dealforest
dealforest / post-checkout
Last active October 10, 2018 15:10
When you switch branch, run the `pod install`. install to `path/to/.git/hooks/`
#!/bin/sh
set -e
prev="$1"
new="$2"
branch_switch="$3"
if [ -z "$branch_switch" ] || [ $branch_switch -eq 0 ]; then
exit 0 # this was a file checkout
# GDB
(gdb) info malloc-history <address>
(gdb) shell malloc_history <pid> <address>
# LLDB
(lldb) command script import lldb.macosx.heap
(lldb) malloc_info --stack-history <address>
define pv
if $argc == 0
po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]
end
if $argc == 1
po [$arg0 recursiveDescription]
end
end
define st