Skip to content

Instantly share code, notes, and snippets.

View jsramraj's full-sized avatar
🎯
Focusing on the custom tooltip library for android

Ramaraj T jsramraj

🎯
Focusing on the custom tooltip library for android
View GitHub Profile
@jsramraj
jsramraj / .gitignore
Created May 5, 2015 08:50
Global gitignore for iOS project
#Xcode project files
*xcodeproj/*mode*
*xcodeproj/*pbxuser
*xcodeproj/*per*
*xcodeproj/project.xcworkspace
*xcodeproj/xcuserdata
*tmproj
*.pbxuser
*.mode1v3
*.xcbkptlist
@jsramraj
jsramraj / MySingleton
Created May 5, 2015 09:07
Create singleton classes for Objective-C
MySingleton.h
---------------
#import <Foundation/Foundation.h>
@interface MySingleton : NSObject
+ (instancetype) sharedSingleton;
@end
@jsramraj
jsramraj / symbolicate_crash
Last active November 11, 2022 05:32
Symbolicate crash logs
How to symbolicate iOS crash logs in Mac?
(Provided you have the crash log, the iOS build in which the crash occured and the .dSYM file)
1. Copy the .crash file and .dSYM file into a folder and navigate to the folder in terminal
2. Run the following command to make sure the correct XCode developer tools is selected, in case you have multiple XCode versions.
`sudo xcode-select --switch /Applications/Xcode\ 6.3.app/Contents/Developer`
3. Finally run the following command to get the symbolicated crash log in the same folder.
DEVELOPER_DIR=`xcode-select -print-path` /Applications/Xcode\ 6.3.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash -o ./MyApp.crash ./MyApp.crash ./MyApp.app.dSYM
How to look up a memory location in the crash log?
@jsramraj
jsramraj / android_gitignore
Last active May 8, 2020 01:36
Gitignore file for Android project that runs in Eclipse
#Mac OS files
.DS_Store
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
@jsramraj
jsramraj / MyConnection.swift
Last active October 22, 2015 11:00
Protocols/Delegates in Swift - Sample
import Foundation
@objc public protocol MyConnectionDelegate {
optional func didStartService(object: String)
optional func didFinishDownload(jsonData: NSData)
optional func didFailedDownload()
}
public class MyConnection {
weak public var delegate: MyConnectionDelegate?
12-23 19:14:35.235: E/SQLiteLog(3133): (11) database corruption at line 53216 of [9491ba7d73]
12-23 19:14:35.235: E/SQLiteLog(3133): (11) statement aborts at 7: [SELECT locale FROM android_metadata UNION SELECT NULL ORDER BY locale DESC LIMIT 1]
12-23 19:14:35.237: E/SQLiteDatabase(3133): Failed to open database '/data/data/com.zanec.dryjanuary/databases/alcochange.sqlite'.
12-23 19:14:35.237: E/SQLiteDatabase(3133): android.database.sqlite.SQLiteException: Failed to change locale for db '/data/data/com.zanec.dryjanuary/databases/alcochange.sqlite' to 'en_US'.
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration(SQLiteConnection.java:459)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:250)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:203)
12-23 19:14:35.237: E/SQLiteDatabase(3133): at android.database.sqlite
@jsramraj
jsramraj / self-signed-certificate-with-custom-ca.md
Created March 16, 2020 17:47 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
- Connect the device via USB and make sure debugging is working
- Run `adb tcpip 5555` in the terminal. This makes the device to start listening for connections on port 5555
- Look up the device IP address with `adb shell netcfg` or `adb shell ifconfig` with 6.0 and higher
- You can disconnect the USB now
- Type `adb connect <DEVICE_IP_ADDRESS>:5555` in the terminal. This connects to the server we set up on the device on step 2
- Now you have a device over the network with which you can debug as usual.
@jsramraj
jsramraj / intent-command
Created July 17, 2020 07:43
Send abd broadcast intent from command line
adb shell "am broadcast 'intent:#Intent;action=com.myCompany.myApp.myAction;d.integerParam=1610;S.stringParam=2020-07-16T08:55:54Z;end'"
@jsramraj
jsramraj / clear_bin.md
Last active July 23, 2020 07:56
Delete bin and obj folders

Quite often you may need to clear the obj and bin folders in the Mac when you work on a xamarin project.

The following command will do that for you.

It will search for all the folders named obj and bin and delete them.

find . -type d \( -name "obj" -o -name "bin" \) -exec rm -rf {} \;