Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@PanosJee
PanosJee / gist:4330479
Created December 18, 2012 18:12
Execute a method before app crash
/* Set Last Action */
public App()
{
// Global handler for uncaught exceptions.
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY");
BugSenseHandler.SetLastBreath(MyMethod);
// ...do more stuff...
}
@PanosJee
PanosJee / gist:4330494
Created December 18, 2012 18:14
User Bugsense along with the VisualStudio debugger
/*
* Alternatively you can initialize the plugin to work
* along with the Visual Studio debugger
*/
public App()
{
// Global handler for uncaught exceptions.
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY", new NotificationOptions() { HandleWhileDebugging = true });
}
@PanosJee
PanosJee / gist:4330511
Created December 18, 2012 18:16
Event tracking for Windows 8, Windows Phone 8
/* Send event */
BugSenseHandler.Instance.SendEvent("anEvent");
@PanosJee
PanosJee / gist:4330524
Created December 18, 2012 18:18
Set a localized fix notification
/* Localized fix notifications */
BugSenseHandler.SetLocalizedFixNotifications(
"Un correctif est disponible", // Title
"S\'il vous plaît mettre à jour à la version dernière" // Content
);
@PanosJee
PanosJee / gist:4599056
Created January 22, 2013 22:13
Windows 8 Store app bugsense initialization
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
// Initialize BugSense
BugSenseHandler.Instance.Init(this, "YOUR_API_KEY");
}
@PanosJee
PanosJee / gist:5004739
Last active December 14, 2015 01:18
sample-bugsense-read-api-response
{
"order": "created",
"total": 1,
"filters": {
"status": "new",
"appver": null,
"tag": null,
"osver": null
},
"error": null,
{
"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,
@PanosJee
PanosJee / bugsense_cli.py
Last active December 14, 2015 01:18
Sample Python BugSense API SDK
# -*- 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
@PanosJee
PanosJee / gist:5170020
Last active December 14, 2015 23:59
Generate Entropy UID for Android
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).
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)