Skip to content

Instantly share code, notes, and snippets.

View fredgrott's full-sized avatar
👾
focusing on flutter cross platform mobile dev

Fred Grott fredgrott

👾
focusing on flutter cross platform mobile dev
View GitHub Profile
@fredgrott
fredgrott / newwaytologusinglog4j
Created January 24, 2012 19:56
new way to log
package com.github.shareme.loga;
import org.apache.log4j.Level;
import de.mindpipe.android.logging.log4j.LogConfigurator;
import android.os.Environment;
import android.util.Config;
/**
@fredgrott
fredgrott / LruContextInMemoryCache
Created February 8, 2012 15:40
LruContextInMemoryCache
/*
* Copyright (C) 2011 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
@fredgrott
fredgrott / android_icon_gimpfu.py
Created February 13, 2012 10:22
androidicon_gimpfu
#!/usr/bin/env python
# GIMP plugin for applying Android menu icon style
# For batch processing, use it like this:
# gimp -i --batch-interpreter=python-fu-eval -b 'pdb.python_fu_androidicon_batch(None, None, "/path/to/pictures/*.svg", "/path/to/res");pdb.gimp_quit(1)'
from gimpfu import *
import glob
import os
import shutil
@fredgrott
fredgrott / twiterbs_image_helper
Created February 14, 2012 20:38
twitterbs_image_helper
{% comment%}<!--
Be careful we do not want to access or iterate an array as an associative
array of associative arrays
We are cheating here by using
assign siteImgArrayObject to tell us what associative array to iterate over
out of collection of associative arrays.
@fredgrott
fredgrott / cukesfordroidsadbcommands
Created February 23, 2012 08:24
CukesforDroidsabdcommmands
- adb shell am instrument com.leandog/com.google.android.testing.nativedriver.server.ServerInstrumentation
- adb forward tcp:54129 tcp:54129a
@fredgrott
fredgrott / gist:2308939
Created April 5, 2012 08:13
android_lint_ant
<condition property="bash.it" value="/bin/bash" else="cmd">
<and>
<not>
<os family="windows"/>
</not>
</and>
</condition>
<property name="lint.script" value="${sdk.dir}/tools/lint"/>
<property name="lint.report" location="${basedir}/project.docs/lintreport.html"/>
@fredgrott
fredgrott / emma-androidcoverage
Created April 22, 2012 01:52
correct emma coverage android
<emma>
<report sourcepath="${tested.project.absolute.dir}/${source.dir}"
verbosity="${verbosity}">
<!-- TODO: report.dir or something like should be introduced if necessary -->
<infileset dir="${tested.project.absoulte.dir}">
<include name="coverage.em"/>
</infileset>
<infileset dir=".">
@fredgrott
fredgrott / android_deviceID.java
Created May 20, 2012 21:46
android deviceID
package org.bitbucket.fredgrott.gwsdroiddeviceid;
import java.util.UUID;
import android.content.Context;
import android.content.SharedPreferences;
/**
* Okay, we have some use cases:
*
package org.bitbucket.fredgrott.gwsdroidlive.app;
import java.io.File;
import java.io.FileFilter;
import java.util.regex.Pattern;
public class NumCPUCores {
/** The device cpu num cores. */
public static int deviceCPUNumCores;
@fredgrott
fredgrott / eclipse_typical.ini
Created May 31, 2012 20:44
a typical eclipse inii file
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.100.v20110505
-product
org.eclipse.epp.package.modeling.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform