Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@PanosJee
PanosJee / gist:6157043
Last active December 20, 2015 15:49
BugSense Helpshift iOS Integration example
// 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"
@PanosJee
PanosJee / gist:6580198
Last active December 23, 2015 04:29 — forked from anonymous/gist:5592740
-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.** { *; }
private async void GoTaskUnawaitedMethod(object sender, RoutedEventArgs e)
{
CrashUnawaitedTaskMethod();
}
private async Task CrashUnawaitedTaskMethod()
{
throw new Exception("Task Unawaited");
}
private async void CrashUnawaitedVoidMethod(object sender, RoutedEventArgs e)
{
throw new Exception("Void Unawaited");
}
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}.
function fetchdata()
local phandle = assert(io.open('event.json', 'r'))
local pdata = phandle:read('*all')
phandle:close()
return pdata
end
wrk.method = 'POST'
wrk.body = fetchdata()
wrk.headers['Content-Type'] = 'application/json'
init([]) ->
% Start the scheduled GC job every minute. Naive!
erlang:send_after(60 * 1000, self(), {gc}),
{ok, no_state}.
handle_info({gc}, State) ->
case erlang:memory(binary) of
% We use more than 500 MB of binary space
Binary when Binary > 500000000 ->
erlang:garbage_collect(self())
@PanosJee
PanosJee / bugsense_cli.py
Last active August 29, 2015 13:56
Upload Proguard Mappings files to BugSense via API
# -*- 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
# run atos
sub symbolize_frames {
my ($images,$bt) = @_;
# create mapping of framework => address => bt frame (adjust for slid)
# and for framework => arch
my %frames_to_lookup = ();
my %arch_map = ();
my %base_map = ();
@PanosJee
PanosJee / gist:d2e3d8160ceb5eef9685
Created June 20, 2014 21:13
Get last day errors across all BugSense projects
import requests
import json
base = 'https://www.bugsense.appspot.com'
def get_all_projects(token, **kwargs):
from datetime import datetime, timedelta
timestamp = (datetime.utcnow() - timedelta(days=1)).replace(hour=23,minute=59,second=59)
base_url = "%s/api/v1/projects.json" % (base)