Skip to content

Instantly share code, notes, and snippets.

View PanosJee's full-sized avatar

Panos Papadopoulos PanosJee

View GitHub Profile
@PanosJee
PanosJee / gist:1273091
Created October 9, 2011 00:15
BugSense-WP7-Installation
public App()
{
BugSenseHandler.Instance.Init(this, "Your_API_Key");
// You app's code
}
@PanosJee
PanosJee / gist:1273974
Created October 9, 2011 18:16
Try/Catch WP7
try {
//Some code to execute
}
catch (Exception ex) {
    BugSenseHandler.HandleError(ex);
}
@PanosJee
PanosJee / gist:1273980
Created October 9, 2011 18:19
Try/Catch WP7 with custom data
try {
    throw new InvalidOperationException("An exception occured while executing in a different thread.");
}
catch (Exception ex) {
    BugSenseHandler.HandleError(ex, string.Format("Happend at user {0}", _user));
}
@PanosJee
PanosJee / gist:1273983
Created October 9, 2011 18:21
You can even override the user notification options
try {
    throw new InvalidOperationException("An exception occured while executing in a different thread.");
}
catch (Exception ex) {
    var overridenOptions = BugSenseHandler.DefaultOptions();
    overridenOptions.Text = ex.Message + Environment.NewLine + "Do you want to send the Exception?";
    overridenOptions.Type = enNotificationType.MessageBoxConfirm;
    BugSenseHandler.HandleError(ex, string.Format("User {0}", _user), overridenOptions);
}
if [[ "$UFW_OTHER_PLATFORM" = "iphonesimulator" ]]
then
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" ARCHS=i386 -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION
else
xcodebuild -project "${PROJECT_FILE_PATH}" -target "${TARGET_NAME}" -configuration "${CONFIGURATION}" -sdk ${UFW_OTHER_PLATFORM}${UFW_SDK_VERSION} BUILD_DIR="${BUILD_DIR}" CONFIGURATION_TEMP_DIR="${PROJECT_TEMP_DIR}/${CONFIGURATION}-${UFW_OTHER_PLATFORM}" $ACTION
fi
@PanosJee
PanosJee / gist:1383223
Created November 21, 2011 16:58
BugSense-jQuery
$(document).ajaxError(function(event, xhr, settings, error) {
Bugsense.notify({
request: xhr,
settings: settings,
error: error
});
});
@PanosJee
PanosJee / gist:1383246
Created November 21, 2011 17:03
BugSense-JS-Settings
// bugsense parameters (required)
this.defaults = {
apiKey: 'YOUR_API_KEY', // modify me
url: 'http://www.bugsense.com/api/js/errors?api_key=' // NON-SSL
};
@PanosJee
PanosJee / gist:1665853
Created January 23, 2012 22:28
Set up BugSense
#import <BugSense-iOS/BugSenseCrashController.h>
// ...
- (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//...
NSDictionary *myStuff = [NSDictionary dictionaryWithObjectsAndKeys:@"myObject", @"myKey", nil];
[BugSenseCrashController sharedInstanceWithBugSenseAPIKey:@"<Your BugSense API Key>"
userDictionary:myStuff
sendImmediately:NO];
@PanosJee
PanosJee / gist:1665864
Created January 23, 2012 22:31
BugSense Log iOS
@try {
// some exception throwing code
} @catch (NSException *exc) {
BUGSENSE_LOG(exc, @"Tag");
}
@PanosJee
PanosJee / gist:1719818
Created February 1, 2012 22:16
oss-android-2
public static String ReadInputStream(InputStream in) throws IOException {
StringBuffer stream = new StringBuffer();
byte[] b = new byte[4096];
for (int n; (n = in.read(b)) != -1;) {
stream.append(new String(b, 0, n));
}
return stream.toString();
}