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
//Property List file name = regions.plist | |
let pListFileURL = Bundle.main.url(forResource: "regions", withExtension: "plist", subdirectory: "") | |
if let pListPath = pListFileURL?.path, | |
let pListData = FileManager.default.contents(atPath: pListPath) { | |
do { | |
let pListObject = try PropertyListSerialization.propertyList(from: pListData, options:PropertyListSerialization.ReadOptions(), format:nil) | |
//Cast pListObject - If expected data type is Dictionary | |
guard let pListDict = pListObject as? Dictionary<String, AnyObject> else { | |
return | |
} |
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
spool clob_export.sql | |
select /*insert*/ * from <TABLE_NAME> where <FIELD>='88c820c4-b295-466b-a1a3-beb55434e0e9'; | |
spool off | |
#Stackoverflow: https://stackoverflow.com/questions/42244941/how-to-export-clob-field-datas-in-oracle-sql-developer |
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
BEGIN | |
FOR cur_rec IN (SELECT object_name, object_type | |
FROM user_objects | |
WHERE object_type IN | |
('TABLE', | |
'VIEW', | |
'PACKAGE', | |
'PROCEDURE', | |
'FUNCTION', | |
'SEQUENCE', |
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
Symbolicate Xcode Crashlogs | |
--------------------------- | |
To properly get symbols from your archived app's dSYM file and get useful information from your BugSense crash reports (or any other crash reports for that matter): | |
1. Copy the stack trace from BugSense into TextEdit or any other text editor. | |
Make sure to use the "clipboard" icon, rather than simply copying the text. | |
Otherwise you will not get the actual memory locations of the stack trace, which are necessary to look up the references using atos and symbolicate your stack trace. | |
2. Open XCode and go to the Organizer | |
3. Find your archive and right-click it, go to open it in the finder. |
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 convertDateFormat(from: String, to: String, dateString: String?) -> String? { | |
let fromDateFormatter = DateFormatter() | |
fromDateFormatter.dateFormat = from | |
var formattedDateString: String? = nil | |
if dateString != nil { | |
let formattedDate = fromDateFormatter.date(from: dateString!) | |
if formattedDate != nil { | |
let toDateFormatter = DateFormatter() | |
toDateFormatter.dateFormat = to | |
formattedDateString = toDateFormatter.string(from: formattedDate!) |
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 printFonts() { | |
let fontFamilyNames = UIFont.familyNames | |
for familyName in fontFamilyNames { | |
print("------------------------------") | |
print("Font Family Name = [\(familyName)]") | |
let names = UIFont.fontNames(forFamilyName: familyName ) | |
print("Font Names = [\(names)]") | |
} | |
} |
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
Development Phase: | |
Step 1: Create Certificate .pem from Certificate .p12 | |
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 | |
Step 2: Create Key .pem from Key .p12 | |
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 | |
Step 3: Optional (If you want to remove pass phrase asked in second step) | |
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem |
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
Apple has introduced an interesting tool with Xcode 6! | |
simctl | |
simclt allows you to control the simulators running | |
run xcrun simctl to get the list of available subcommands. Lots of new options to play around. | |
Now to do what I wanted. Here is the command to launch simulator |
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
Change the user login default shell to zsh: | |
chsh -s /bin/zsh | |
ksh: | |
chsh -s /bin/ksh | |
tcsh: | |
chsh -s /bin/tcsh | |
bash (default): |
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
Problem: | |
-------- | |
Sometimes it happens that "Show in Finder" does not work to open in new window. | |
Also, in Xcode when you right click any file and try to "Show in Finder" it does not show up. | |
Solution: | |
--------- | |
As an alternative to this bug's solution, try to run below terminal command: | |
sudo killall -KILL appleeventsd |
NewerOlder