Skip to content

Instantly share code, notes, and snippets.

View KarlNosworthy's full-sized avatar

Karl Nosworthy KarlNosworthy

View GitHub Profile
@KarlNosworthy
KarlNosworthy / build.gradle
Last active August 29, 2015 14:07
A default build.gradle file for Android apps that includes dependency injection support, headless testing and mocks for CI and AssertJ to make testing sweeter.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.3'
classpath 'com.jakewharton.sdkmanager:gradle-plugin:0.12.0'
classpath 'org.robolectric:robolectric-gradle-plugin:0.13.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
@KarlNosworthy
KarlNosworthy / .travis.yaml
Created October 16, 2014 10:37
Simple Travis CI script for Android builds
language: android
jdk: oraclejdk7
before_install:
- chmod +x gradlew
script: ./gradlew check
# gimpy mac thingy
.DS_Store
# IDEA Ignores
*.iml
*.ipr
*.iws
.idea/
# Local configuration file (sdk path, etc)
@KarlNosworthy
KarlNosworthy / gist:f024b3ae415da247e06e
Created December 16, 2014 18:24
Search to find popular, public Java based projects with issues in Github.
language:java type:issue is:public stars:">=20"
@KarlNosworthy
KarlNosworthy / NSMutableAttributedStringExtension.swift
Created February 17, 2015 22:27
An attributed string extension which provides a new method to simply find and make links out of specified strings.
import Foundation
extension NSMutableAttributedString {
public func setAsLink(textToFind:String, linkURL:String) -> Bool {
let foundRange = self.mutableString.rangeOfString(textToFind)
if foundRange.location != NSNotFound {
self.addAttribute(NSLinkAttributeName, value: linkURL, range: foundRange)
return true
@KarlNosworthy
KarlNosworthy / gist:acba2452a67617ee079b
Created July 18, 2015 12:04
Pulling a sqlite databases from a non rooted android device
#
# Copy the database from its standard location to the sd card
#
adb -d shell "run-as <app.package.name.here> cat /data/data/<app.package.name.here>/databases/<app.database.name.here> /sdcard/<output.filename.here>"
#
# Pull the database from the sdcard to a specified local filename or the current directory if not
#
adb pull /sdcard/<remote.filename.here> [<local.filename.here>]