Skip to content

Instantly share code, notes, and snippets.

🎯

ygit

🎯
Block or report user

Report or block ygit

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ygit
ygit / XcrunDemangleScript.sh
Created May 11, 2019
A xcrun bash script to demangle symbols
View XcrunDemangleScript.sh
FILE=$1
ANOTHER_FILE=$2
exec 4> "$ANOTHER_FILE"
while read -ru 3 LINE; do
line="$LINE"
linearray=($line)
echo ${linearray[2]}
xcrun c++filt "${linearray[2]}" >&4
@ygit
ygit / Local_Podfile
Created Apr 24, 2019
Point to local Podspecs repo instead of Master/Trunk Podspecs
View Local_Podfile
platform :ios, '9.0'
workspace '../WebEngageAll'
source 'https://github.com/WebEngage/podspecs.git'
# source 'https://github.com/CocoaPods/Specs.git'
def app_pods
pod 'WebEngage' #:path => '../Built'
@ygit
ygit / RandomInt.swift
Created Apr 4, 2019
Random Int Generator Swift Extension
View RandomInt.swift
extension Int {
var arc4random: Int {
if self > 0 {
return Int(arc4random_uniform(UInt32(self)))
} else if self < 0 {
return -Int(arc4random_uniform(UInt32(abs(self))))
} else {
return 0
}
}
@ygit
ygit / OnlyIphoneArchsFrameworkScript
Created Oct 26, 2018
Build only iPhone device archs(excluding simulator) framework using lipo
View OnlyIphoneArchsFrameworkScript
######################
# Options
######################
set -x
set -e
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
@ygit
ygit / Persistent Store Migration
Last active Mar 19, 2018
Core Data Persistent Store Migration
View Persistent Store Migration
// for custom overwrites within an entity like changing an attribute from Boolean to NSNumber, etc
- (BOOL)createDestinationInstancesForSourceInstance:(NSManagedObject *)sInstance
entityMapping:(NSEntityMapping *)mapping
manager:(NSMigrationManager *)manager
error:(NSError **)error {
NSManagedObject *newObject =
[NSEntityDescription insertNewObjectForEntityForName:[mapping destinationEntityName]
inManagedObjectContext:[manager destinationContext]];
// do transfer of nsdate to nsstring non-lightweight operations here
@ygit
ygit / Delete Multiple Remotes
Created Dec 1, 2017
Delete multiple remote branches in git
View Delete Multiple Remotes
git branch -r | awk -F/ '/\/PREFIX/{print $2}'
git branch -r | awk -F/ '/\/PREFIX/{print $2}' | xargs -I {} git push origin :{}
@ygit
ygit / README-Template.md
Created Mar 29, 2017 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View Purge Xcode Derived Data
rm -rf ~/Library/Developer/Xcode/DerivedData/*
View Display time of Operations in Xcode
defaults write com.apple.dt.Xcode ShowBuildOperationDuration YES
View Question 2 Solution
- (void)solution{
NSArray *list = @[@"end", @"back", @"and", @"the", @"po", @"pu", @"lar", @"face"]; //populate with any list of strings here
NSString *inputStr = @"facebackandthethethefacebackpopularlarpopu"; //or input any string here
BOOL canBeFormed = [self checkForString:inputStr.mutableCopy inList:list];
if (canBeFormed) {
NSLog(@"YES! %@ can be formed from the list.", inputStr);
You can’t perform that action at this time.