Skip to content

Instantly share code, notes, and snippets.

View AwayQu's full-sized avatar
🌊
langlanglang

文档工程师 AwayQu

🌊
langlanglang
View GitHub Profile
// swift 5.1
//
// nameRow.rx.value.orEmpty.bind(to: vm.nameReplay).disposed(by: disposeBag)
// vm.nameReplay.asObservable().bind(to: nameRow.rx.value).disposed(by: disposeBag)
//
extension RowOf: ReactiveCompatible {}
extension Reactive where Base: RowType, Base: BaseRow {
var value: ControlProperty<Base.Cell.Value?> {
let source = Observable<Base.Cell.Value?>.create { observer in
@AwayQu
AwayQu / easyiossymbolication
Created June 17, 2019 06:06 — forked from fbeeper/easyiossymbolication
Looking for an easy way to symbolicate crashes?
#!/bin/bash
#
# Fool'n'Lazy-Proof iOS .crash Symbolication
#
# Just run this script on a folder with your `.ipa`, the corresponding `.dSYM`,
# and (1+) `.crash` files. Will output symbolicated `sym-*.crash`es for you.
#
# Copyright (c) 2016 Ferran Poveda (@fbeeper)
# Provided under MIT License (MIT): http://choosealicense.com/licenses/mit/
@AwayQu
AwayQu / dropa
Last active April 13, 2019 17:19
Update by Death Gist
https://juejin.im/?utm_source=gold_browser_extension
@AwayQu
AwayQu / tcpdump.sh
Last active April 13, 2019 17:09
Update by Death Gist
tcpdump -iany -X -s0 -nn port 9528
telnet 10.0.13.22 9528
telnet 10.0.13.22 9528
@AwayQu
AwayQu / DDTTYLogger.m
Last active April 13, 2019 11:58
Update by Death Gist
// Software License Agreement (BSD License)
//
// Copyright (c) 2010-2018, Deusty, LLC
// All rights reserved.
//
// Redistribution and use of this software in source and binary forms,
// with or without modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
@AwayQu
AwayQu / NSBezierPath+cgPath.swift
Created November 26, 2018 14:12 — forked from juliensagot/NSBezierPath+cgPath.swift
Convert NSBezierPath to CGPath (Swift 4, Xcode 9.2)
extension NSBezierPath {
var cgPath: CGPath {
get { return self.transformToCGPath() }
}
/// Transforms the NSBezierPath into a CGPath
///
/// :returns: The transformed NSBezierPath
private func transformToCGPath() -> CGPath {

How to Download iOS Simulator (Xcode) in Command Line and Install it

For faster connection speed and more flexibility.

Steps

  1. Start Xcode in command line by running this in commandline /Applications/Xcode.app/Contents/MacOS/Xcode
  2. Start downloading of the simulator
  3. Cancel it. YES CANCEL IT!
  4. You will get a message like this:
@AwayQu
AwayQu / change png alpha
Last active April 14, 2019 06:01
Update by Death Gist
convert input.png -alpha off output.png
find . -name "*.png" -exec convert "{}" -alpha off "{}" \;
convert input.png -channel A -threshold 254 output.png
mkdir batch
FOR %G IN (*.png) DO convert %G -channel A -threshold 254 batch\%G
# color space
convert app_icon.jpg -colorspace sRGB -type truecolor result.jpg
@AwayQu
AwayQu / convert_keras.py
Last active April 14, 2019 05:01
Update by Death Gist
import coremltools
output_labels = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'X']
scale = 1/255.
coreml_model = coremltools.converters.keras.convert('./KGNetCNN.h5',
input_names='image',
image_input_names='image',
output_names='output',
class_labels=output_labels,
@AwayQu
AwayQu / convert_model.py
Created April 8, 2018 08:12 — forked from boaerosuke/convert_model.py
Using coremltools to convert a Keras model into mlmodel for iOS
import coremltools
import numpy
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import Dropout
from keras.utils import np_utils
from keras.models import load_model