Skip to content

Instantly share code, notes, and snippets.

Avatar

Karl Nosworthy KarlNosworthy

View GitHub Profile
@KarlNosworthy
KarlNosworthy / gist:acba2452a67617ee079b
Created Jul 18, 2015
Pulling a sqlite databases from a non rooted android device
View gist:acba2452a67617ee079b
#
# 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>]
@KarlNosworthy
KarlNosworthy / NSMutableAttributedStringExtension.swift
Created Feb 17, 2015
An attributed string extension which provides a new method to simply find and make links out of specified strings.
View NSMutableAttributedStringExtension.swift
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:f024b3ae415da247e06e
Created Dec 16, 2014
Search to find popular, public Java based projects with issues in Github.
View gist:f024b3ae415da247e06e
language:java type:issue is:public stars:">=20"
View .gitignore
# gimpy mac thingy
.DS_Store
# IDEA Ignores
*.iml
*.ipr
*.iws
.idea/
# Local configuration file (sdk path, etc)
@KarlNosworthy
KarlNosworthy / .travis.yaml
Created Oct 16, 2014
Simple Travis CI script for Android builds
View .travis.yaml
language: android
jdk: oraclejdk7
before_install:
- chmod +x gradlew
script: ./gradlew check
@KarlNosworthy
KarlNosworthy / build.gradle
Last active Aug 29, 2015
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.
View build.gradle
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'