This file contains hidden or 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
init([]) -> | |
% Start the scheduled GC job every minute. Naive! | |
erlang:send_after(60 * 1000, self(), {gc}), | |
{ok, no_state}. | |
handle_info({gc}, State) -> | |
erlang:garbage_collect(self()), | |
erlang:send_after(60 * 1000, self(), {gc}), | |
{noreply, State}. |
This file contains hidden or 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
private async void CrashUnawaitedVoidMethod(object sender, RoutedEventArgs e) | |
{ | |
throw new Exception("Void Unawaited"); | |
} |
This file contains hidden or 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
private async void GoTaskUnawaitedMethod(object sender, RoutedEventArgs e) | |
{ | |
CrashUnawaitedTaskMethod(); | |
} | |
private async Task CrashUnawaitedTaskMethod() | |
{ | |
throw new Exception("Task Unawaited"); | |
} |
This file contains hidden or 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
-optimizationpasses 25 | |
-dontusemixedcaseclassnames | |
-dontskipnonpubliclibraryclasses | |
-dontpreverify | |
-verbose | |
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* | |
-printmapping out.map | |
-renamesourcefileattribute SourceFile | |
-keepattributes SourceFile,LineNumberTable | |
-keep class com.bugsense.** { *; } |
This file contains hidden or 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
// in didFinishLaunchingWithOptions at AppDelegate.m | |
[BugSenseController setErrorNetworkOperationsCompletionBlock:^() { | |
NSLog(@"Application crashed with errorId: %ld with an error count since last reset: %d", [BugSenseController lastCrashId], [BugSenseController crashCount]); | |
if ([BugSenseController crashCount] == 1) { // after every crash, customize! | |
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"We're sorry!" | |
message:@"We are aware of the crashes that you have experienced lately. Would you like to tell us more about it?" | |
delegate:self | |
cancelButtonTitle:@"No" |
This file contains hidden or 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 stripe | |
import collections | |
from texttable import Texttable | |
# TODO add pagination | |
# I will update this gist shortly when pagination is added | |
stripe_customers = stripe.Customer.all(count=100) | |
by_status = collections.defaultdict(list) |
This file contains hidden or 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
private static String generateUid() { | |
// STEP 1: get time since Epoch. | |
// OUTPUT: timestamp in millisecond (or finer) granularity. | |
// RATIONALE: collision only when app is deployed at the exact same time. | |
final String s1 = Long.valueOf((new Date()).getTime()).toString(); | |
// STEP 2: get an object reference. | |
// OUTPUT: memory address or another distinguishable object property. | |
// RATIONALE: very little probability for two runs to get the | |
// same address (debatable when in a sandbox). |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
""" | |
bugsense_cli.py | |
~~~~ | |
Sample script to upload dSYMSs and access the Read API | |
:version: 0.1 | |
:copyright: 2013 by bugsense.com. | |
""" | |
from urllib import quote |
This file contains hidden or 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
{ | |
"stacktrace": [ | |
"java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState", | |
"at android.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1265)", | |
"at android.app.FragmentManagerImpl.popBackStackImmediate(FragmentManager.java:451)", | |
"at android.app.Activity.onBackPressed(Activity.java:2121)", | |
"at dalvik.system.NativeStart.main(Native Method)" | |
], | |
"error": { | |
"resolved": null, |
This file contains hidden or 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
{ | |
"order": "created", | |
"total": 1, | |
"filters": { | |
"status": "new", | |
"appver": null, | |
"tag": null, | |
"osver": null | |
}, | |
"error": null, |