Skip to content

Instantly share code, notes, and snippets.

View AndreasBoehm's full-sized avatar

Andreas Böhm AndreasBoehm

View GitHub Profile
@AndreasBoehm
AndreasBoehm / EmojiPointersDemo.swift
Created August 21, 2018 08:39 — forked from cellularmitosis/EmojiPointersDemo.swift
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@AndreasBoehm
AndreasBoehm / Dockerfile
Last active November 16, 2018 00:10
docker-android-sdk
FROM openjdk:8-jdk
ENV ANDROID_TOOLS_ZIP https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
ENV ANDROID_HOME /opt/android-sdk-linux
ENV PATH $PATH:$ANDROID_HOME/tools
ENV PATH $PATH:$ANDROID_HOME/tools/bin
ENV PATH $PATH:$ANDROID_HOME/platform-tools
# install base tools
# LAN-Adapter -> Gigabit Switch -> 25m cable -> Gigabit Switch -> Server
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.0 sec 1.09 GBytes 940 Mbits/sec
# WLAN -> FritzBox 7170 (802.11g) -> Gigabit Switch -> 25m cable -> Gigabit Switch -> Server
[ ID] Interval Transfer Bandwidth
[ 5] 0.0-10.0 sec 15.8 MBytes 13.2 Mbits/sec
# WLAN -> FritzBox 7490 #2 (802.11n) -> 25m cable -> FritzBox 7490 #1 -> cable -> Server
[ ID] Interval Transfer Bandwidth
@AndreasBoehm
AndreasBoehm / bavariaipsum.sublime-snippet
Created September 15, 2014 13:17
A sublime text 2 snippet with bavaria ipsum (http://bavaria-ipsum.de/)
<snippet>
<content>
<![CDATA[Bavaria ipsum dolor sit amet Namidog de Sonn spernzaln, Steckerleis. A bissal luja de nimma is ma Wuascht hob Goaßmaß mechad dringma aweng, Vergeltsgott Stubn. Hemad Wurscht Schdarmbeaga See muass gscheckate oba back mas Kneedl Gaudi: Weida wos Brotzeit Lewakaas, Leonhardifahrt nackata da, hog di hi dringma aweng i mechad dee Schwoanshaxn. A Maß und no a Maß auszutzeln Griasnoggalsubbm, Graudwiggal gwiss. Kummd auf’d Schellnsau singd Brotzeit, umananda resch? Wolln an nix Brodzeid middn!]]>
</content>
<tabTrigger>bavariaipsum</tabTrigger>
<description>Bavaria Ipsum snippet</description>
</snippet>
@AndreasBoehm
AndreasBoehm / re-sign-ipa.sh
Created June 25, 2014 07:40
Shellscript to resign a .ipa package
# !/bin/bash
# Functions used in the script
# ------------------------------------------------------------------------------
# Function to print usage report to stderr
function print_usage {
cat - >&2 <<UsageDelimiter
@AndreasBoehm
AndreasBoehm / gist:8023013
Last active March 10, 2016 15:47
ViewPager getOffScreenLimitForDevice
private int getOffScreenLimitForDevice() {
ActivityManager am = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
int memoryClass = am.getMemoryClass();
Log.v(LOG_TAG, "memoryClass:" + Integer.toString(memoryClass));
/*
HTC Desire: 32
Galaxy S2: 48
*/
if (memoryClass <= 48) {
@AndreasBoehm
AndreasBoehm / density_switch.sh
Created November 13, 2013 16:10
Simulate Screendensity and Resolutions for App-Development
#!/bin/bash
# Switches density and resolution of connected Android Device
# Set path to adb here, if adb is in path only write adb
ADB='/usr/local/android-bin/adb'
MDPI_DENSITY="160"
MDPI_RES="320x480"
HDPI_DENSITY="240"
@AndreasBoehm
AndreasBoehm / gist:5502052
Created May 2, 2013 13:09
Always use https:// instead of git://. Useful behind firewalls.
git config --global url.https://.insteadOf git://