Skip to content

Instantly share code, notes, and snippets.

View ming-chu's full-sized avatar
:octocat:
Focusing

Kenneth Chu ming-chu

:octocat:
Focusing
View GitHub Profile
#/bin/sh
#Retrieve uuid from DSYM
$dwarfdump --uuid your_app.dSYM | cut -d ' ' -f 2
@ming-chu
ming-chu / check_appdynamics_dsym_is_uploaded_or_not.sh
Last active February 5, 2018 04:43
check appdynamics dsym is uploaded or not
#/bin/sh
#prepare the settings
ADRUM_ACCOUNT_NAME="xxxxx-a23413453"
ADRUM_LICENSE_KEY="1234132-1234-1234-1234-12341234123"
ADRUM_EUM_PROCESSOR="https://app.domain.net"
ADRUM_ACCOUNT_NAME="xxxxxx-ajksjdkfasdf"
uuid="XXXX-XXXX-XXXX-XXXX-XXXXXXX"
#Check is uploaded or not by calling the folowing api
@ming-chu
ming-chu / vba-count-hours.vba
Last active March 1, 2018 16:10
vba-count-hours
Function COUNT_HOURS(startEndTime As String)
'Will count the hours between times in format "1230-1500"
'====================================
Dim countHours As Double
countHours = 0
Dim times() As String: times = Split(startEndTime, "-")
@ming-chu
ming-chu / UIView+App.swift
Created March 6, 2018 07:16
Find a view by using accessibilityIdentifier estension
extension UIView {
func findViewByAccessibilityIdentifier(accessibilityIdentifier identifier: String) -> UIView? {
for view in self.subviews {
if view.accessibilityIdentifier == identifier {
return view
}
}
return nil
}
}
@ming-chu
ming-chu / Extensions+URLRequest.swift
Created March 7, 2018 03:43
Swift Convert URLRequest to curl command
extension URLRequest {
func toCurlCommand() -> String {
func escapeTerminalString(_ value: String) -> String {
return value.replacingOccurrences(of: "\"", with: "\\\"", options:[], range: nil)
}
let method = self.httpMethod ?? "GET"
var returnValue = "curl -i \n -X \(method) "
for (key, value) in self.allHTTPHeaderFields ?? [:] {
@ming-chu
ming-chu / getBuildNumberFromPlist.sh
Last active March 30, 2018 07:16
Get build number using PlistBuddy
# INFOPLIST_FILE="xxx/Info.plist"
# echo $INFOPLIST_FILE
# get current plist file path=> $ what-marketing-version | grep "Found" | awk '{print $NF}'
# awk '{print $NF}'; will split the sentense and get the last one (NF=number of fields in the current record)
#
#PLIST_PATH=$(agvtool what-marketing-version | grep "Found" | awk '{print $NF}')
#PLIST_PATH="${PLIST_PATH%\"}"
#PLIST_PATH="${PLIST_PATH#\"}"
#(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PLIST_PATH")
@ming-chu
ming-chu / find_symbolicatecrash.sh
Last active April 9, 2018 10:10
Find symbolicatecrash path for DSYM file symbolicate
#/bin/sh
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
find /Applications/Xcode.app/ -name "symbolicatecrash" | grep "SharedFrameworks"
#/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash
#This app can sybolicate the *.crash, *.ips files, it really helps!
symbolicatecrash --dsym /path/xxxx.xcarchive/dSYMs --output name.symbolicated.crash name.crash
#import <AVFoundation/AVFoundation.h>
#import "Recorder.h"
@interface Recorder()<AVCaptureAudioDataOutputSampleBufferDelegate>{
AVCaptureDevice *audioDevice;
AVCaptureDeviceInput *audioInput;
AVCaptureAudioDataOutput* _audioDataOutput;
dispatch_queue_t _captureQueue;
AVURLAsset *_asset;
@ming-chu
ming-chu / FilterCam.swift
Created September 14, 2018 13:12 — forked from bgayman/FilterCam.swift
Setup AVCaptureSession with CIFilter
//
// ViewController.swift
// CameraFilter
//
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
@ming-chu
ming-chu / AssetRecorderView.swift
Created November 22, 2018 03:28 — forked from levantAJ/AssetRecorderView.swift
Record video, with auto detect faces, and overlay mask into faces
//
// AssetRecorderView.swift
// Snowball
//
// Created by Le Tai on 7/20/16.
// Copyright © 2016 Snowball. All rights reserved.
//
import UIKit
import AVFoundation