Skip to content

Instantly share code, notes, and snippets.

View AwayQu's full-sized avatar
🌊
langlanglang

文档工程师 AwayQu

🌊
langlanglang
View GitHub Profile
@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 / 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 / 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
@AwayQu
AwayQu / logging_subprocess.py
Created September 27, 2017 03:13 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.
@AwayQu
AwayQu / logging_subprocess.py
Created September 27, 2017 03:13 — forked from bgreenlee/logging_subprocess.py
Variant of subprocess.call that accepts a logger instead of stdout/stderr #python
import subprocess
import select
from logging import DEBUG, ERROR
def call(popenargs, logger, stdout_log_level=DEBUG, stderr_log_level=ERROR, **kwargs):
"""
Variant of subprocess.call that accepts a logger instead of stdout/stderr,
and logs stdout messages via logger.debug and stderr messages via
logger.error.