This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$0.29 | |
$0.39 | |
$0.49 | |
$0.59 | |
$0.69 | |
$0.79 | |
$0.89 | |
$0.90 | |
$0.95 | |
$0.99 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat skype_export.json | jq -r '.conversations[] | select(.displayName != null) | select(.displayName | contains("PEER NAME HERE")) | .MessageList[] | select(.messagetype == "Event/Call") | .content' | grep 'ended' | sed -e 's/^.*callId="\([^"]*\)".*<duration>\(.*\)<\/d.*$/\1 \2/g' | uniq | sed 's/^.* \(.*\)$/\1/g' | awk '{ SUM += $1} END { printf "%.2f", SUM }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
command alias objc expression -l objc -O -- | |
command regex swift 's#(.+)#expression -l Swift -O -- defer { CATransaction.flush() }; %1#' | |
breakpoint set -n AppDelegate.application --one-shot true --auto-continue true | |
breakpoint command add | |
swift import Foundation | |
swift import UIKit | |
swift import MyApp_tvOS | |
swift import MyApp_iOS | |
swift func $printSubviews(of view: UIView) { print(view.perform("recursiveDescription")!) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension URLRequest { | |
func curlString() -> String { | |
var curl = "curl --insecure" | |
// Method | |
if let method = httpMethod { | |
curl += " -X \(method)" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xcrun simctl --set testing list | grep Booted | grep Clone | sed 's/^.*(\([A-Z0-9\-]*\)).*$/\1/g' | xargs -I {} xcrun simctl --set testing shutdown "{}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while read -r line ; do echo "$line"; sed -i '' 's/^ *$//g' "$line"; done < <(grep -rl --exclude-dir Pods --include "*.swift" "^ *$" .) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func print_args(function: String = #function, prefix: String = "", _ args: Any...) { | |
let log = function | |
.components(separatedBy: ":") | |
.enumerated() | |
.reduce(prefix.isEmpty ? "" : prefix + " ") { (log, arg1) -> String in | |
let (idx, chunk) = arg1 | |
if idx == args.count - 1 { | |
return log + "\(chunk): \(args[idx])" | |
} else if idx < args.count { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in {0..999}; do i=$(printf "%03d" $i); echo -en " Downloading $i\r"; curl -s --fail "<url>/segment_$i.ts" >> /tmp/test.ts || break; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@class UINavigationBar; | |
NS_ASSUME_NONNULL_BEGIN | |
@interface OSThirteenDynamicFixes: NSObject | |
/** | |
On iOS 13.0+, ensure the background color and title properties are set properly (they are not available in Xcode 10, these are from a future SDK) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DEVELOPER_DIR=/Applications/Xcode9-beta.app/Contents/Developer/ swift text-to-flags.swift | |
import Foundation | |
let input = CommandLine.arguments[1].uppercased() | |
if input.rangeOfCharacter(from: CharacterSet(charactersIn: "ABCDEFGHIJKLMNOPQRSTUVWXYZ").inverted) != nil { | |
fatalError("unsupported character found") | |
} | |
func request(_ r: URLRequest) -> [String] { |
NewerOlder