Skip to content

Instantly share code, notes, and snippets.

@nahba
nahba / AndroidWithJenkins
Created March 29, 2017 05:47
Android Jenkins (Platform: Windows 7 - 64Bit)
1. Download Jenkins from https://jenkins.io/download/
2. Using CMD, run this command "java -jar jenkins.war". This will create .jenkins folder in C:\Users\(USER_NAME)\.jenkins
- Make sure you have installed JDK and set path
3. Open Jenkins using http://localhost:8080/
4. Go to "Manage Jenkins"
5. Go to "Configure Global Security"
- Enable security
- Security Realm -> Jenkins’ own user database (+ Allow users to sign up)
- Authorization -> Matrix-based security
- Add new User and check all checkboxes
@nahba
nahba / app.gradle
Created March 29, 2017 06:49
Gradle specific tasks
1. If you need to disable all transitive dependencies and apply by yourself
configurations.all {
transitive = false
}
2. How check dependencies tree (Terminal in AndroidStudio)
gradlew/gradlew.bat -q dependencies app:dependencies --configuration compile/testCompile/androidTestCompile
@nahba
nahba / Regex.java
Created May 24, 2017 12:41
Regex Java
1. Replace character(s) other than specified
String name = "android";
name = name.replaceAll("[^an]", "");
Output:: "an"
2. Separate word with space from String
String name = "AndroidIsOpenSource";
name = name.replaceAll("(.)([A-Z])", "$1 $2");
Output:: "Android Is Open Source"