Skip to content

Instantly share code, notes, and snippets.

this.Loaded += async (sender, args) =>
{
await Task.Delay(5000);
int totalCrashes = await BugSenseHandler.Instance.GetTotalCrashesNum();
Debug.WriteLine("TotalCrashes: {0}", totalCrashes);
if (totalCrashes > 10)
{
await BugSenseHandler.Instance.ClearTotalCrashesNum();
Debug.WriteLine("TotalCrashes after clear: {0}", await BugSenseHandler.Instance.GetTotalCrashesNu());
}
[BugSenseController setErrorNetworkOperationsCompletionBlock:^() {
NSLog(@"Application crashed with errorId: %ld with an error count since last reset: %d", [BugSenseController lastCrashId], [BugSenseController crashCount]);
if ([BugSenseController crashCount] > 5) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"We're sorry!" message:@"We are aware of the crashes that you have experienced lately, and are actively working on fixing them for the next version!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
[BugSenseController resetCrashCount];
}
}];
// Get the total number of crashes
int totalCrashes = BugSenseHandler.getTotalCrashesNum();
// Get last error id
String lastErrorID = BugSenseHandler.getLastCrashID();
// Clear total crashes
BugSenseHandler.clearTotalCrashesNum();
@Override
public void lastBreath(Exception ex) {
//do or save stuff here
}

Build your own private, encrypted, open-source Dropbox-esque sync folder

Prerequisites:

  • One or more clients running a UNIX-like OS. Examples are given for Ubuntu 12.04 LTS, although all software components are available for other platforms as well (e.g. OS X). YMMV
  • A cheap Ubuntu 12.04 VPS with storage. I recommend Backupsy, they offer 250GB storage for $5/month. Ask Google for coupon codes.

Software components used:

  • Unison for file synchronization
  • EncFS for folder encryption
// Setup search by username on iOS
[BugSenseController setUserIdentifier:@"239859"];
// Setup search by username on Window Phone
BugSense.Handler.SetUserIdentifier(string identifier)
// Setup search by username on Android
BugSenseHandler.setUserIdentifier(String userIdentifier);
@tsironis
tsironis / gist:5797819
Last active December 18, 2015 14:29 — forked from PanosJee/gist:3551914
ICollection<CrashExtraMap> map = new Collection<CrashExtraMap>();
map.Add(new CrashExtraData
{
Key = "level",
Value = "second level"
});
map.Add(new CrashExtraData
{
Key = "difficulty",
Value = "impossibruuu"
@tsironis
tsironis / gist:5797758
Last active December 18, 2015 14:29 — forked from PanosJee/gist:3551885
try{
String a = null;
a.toString();
}catch(Exception ex) {
BugSenseHandler.Instance.SendException(ex);
}