Skip to content

Instantly share code, notes, and snippets.

@sabadow
sabadow / gist:2395148dba5abd85da38
Created July 11, 2015 06:46
Ninja Raiden Safari Crash
Process: com.apple.WebKit.WebContent [1251]
Path: /System/Library/Frameworks/WebKit.framework/Versions/A/XPCServices/com.apple.WebKit.WebContent.xpc/Contents/MacOS/com.apple.WebKit.WebContent
Identifier: com.apple.WebKit.WebContent
Version: 10600 (10600.7.12)
Build Info: WebKit2-7600007012000000~2
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Safari [1001]
User ID: 501
@sabadow
sabadow / MainActivity.java
Last active July 4, 2017 11:32
Fabric time line custom adapter to overrides onClick event
import android.app.ListActivity;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
import com.twitter.sdk.android.Twitter;
import com.twitter.sdk.android.core.TwitterAuthConfig;
import com.twitter.sdk.android.core.models.Tweet;
/*
* Copyright (C) 2014 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
afterEvaluate { project ->
android.applicationVariants.each { variant ->
variant.javaCompile.dependsOn stripPlayServices
}
}
task stripPlayServices << {
def playServiceRootFolder = new File(rootProject.buildDir, "intermediates/exploded-aar/com.google.android.gms/play-services/")
playServiceRootFolder.list().each { versionName ->
def versionFolder = new File(playServiceRootFolder, versionName)
@sabadow
sabadow / Main.java
Last active June 16, 2020 16:08
Simple Heroku DB example with JSP and JDBC for DevBurgos
package com.example;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.webapp.WebAppContext;
/**
* This class launches the web application in an embedded Jetty container.
*/
public class Main {
<%@page import="java.sql.*, javax.sql.*, javax.naming.*"%>
<%
DataSource ds = null;
Connection conn = null;
ResultSet result = null;
Statement stmt = null;
ResultSetMetaData rsmd = null;
try{
Context context = new InitialContext();
Context envCtx = (Context) context.lookup("java:jboss/datasources");
@sabadow
sabadow / monkeyrunnerTestSuite.py
Created October 25, 2013 12:20
github / gauges-android monkey runner
# Imports the monkeyrunner modules used by this program
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
# Connects to the current device, returning a MonkeyDevice object
device = MonkeyRunner.waitForConnection()
# Installs the Android package. Notice that this method returns a boolean, so you can test
# to see if the installation worked.
device.installPackage('../app/target/gauges-android-1.0.apk')
@sabadow
sabadow / gist:5998086
Last active December 19, 2015 18:19
Create a release (based on robovm project)
  • Create release branch:
git branch rb-<version>
  • Update the master branch to the next -SNAPSHOT version:
mvn -Dtycho.mode=maven org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=-SNAPSHOT
@sabadow
sabadow / gist:4274923
Created December 13, 2012 08:10
Image with rounded corners by Romain Guy
BitmapShader shader;
shader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);
Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setShader(shader);
RectF rect = new RectF(0.0f, 0.0f, width, height);
// rect contains the bounds of the shape
@sabadow
sabadow / BitmapHelper.java
Created October 31, 2012 15:24
Android BitmapHelper
import java.io.InputStream;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
public class BitmapHelper {
public static int calculateInSampleSize(BitmapFactory.Options options,int reqWidth, int reqHeight) {
// Raw height and width of image
final int height = options.outHeight;
final int width = options.outWidth;