Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Phuchit Sirimongkolsathien ripzery

View GitHub Profile
View jenkins-notes.md

I just had to set up Jenkins to use GitHub. My notes (to myself, mostly):

Detailed Instructions

For setting up Jenkins to build GitHub projects. This assumes some ability to manage Jenkins, use the command line, set up a utility LDAP account, etc. Please share or improve this Gist as needed.

Install Jenkins Plugins

@ripzery
ripzery / MainActivity.java
Created Mar 24, 2017
findViewById no need casting
View MainActivity.java
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
View build.gradle
android {
compileSdkVersion 'android-O'
buildToolsVersion '26.0.0-rc1'
defaultConfig {
targetSdkVersion 'O'
}
}
dependencies {
@ripzery
ripzery / preview_sizes_autosizing_textview.xml
Created Mar 23, 2017
Preset sizes autosizing textview
View preview_sizes_autosizing_textview.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoSizePresetSizes="@array/autosize_text_sizes" />
@ripzery
ripzery / preset_sizes_array.xml
Last active Mar 23, 2017
Preset sizes autosizing textview
View preset_sizes_array.xml
<resources>
<array
name="autosize_text_sizes">
<item>10sp</item>
<item>12sp</item>
<item>20sp</item>
<item>40sp</item>
<item>100sp</item>
</array>
</resources>
@ripzery
ripzery / autosizing_textview.xml
Last active Mar 23, 2017
Granularity Autosizing TextView
View autosizing_textview.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoSizeMinTextSize="12sp"
android:autoSizeMaxTextSize="100sp"
android:autoSizeStepGranularity="2sp" />
@ripzery
ripzery / fonts.xml
Created Mar 23, 2017
A sample file for custom font in XML (Android O)
View fonts.xml
<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font
android:fontStyle="normal"
android:fontWeight="400"
android:font="@font/lobster_regular" />
<font
android:fontStyle="italic"
android:fontWeight="400"
android:font="@font/lobster_italic" />
@ripzery
ripzery / log_gcm_structure
Last active Oct 18, 2016
gcm structure from tsl which uses notification payload
View log_gcm_structure
10-18 23:58:21.170 25945-26010/com.socket9.thetsl D/MyGRcmListenerService: From: 197311876504
10-18 23:58:21.172 25945-26010/com.socket9.thetsl I/MyGcmListenerService: Bundle[{google.sent_time=1476809900797, type=SERVICE BOOKING, google.message_id=0:1476809900806468%43ae439143ae4391, notification=Bundle[{body=รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริการที่ TSL Auto Service ในวันที่ 21/09/2016 เวลา 15:19:00 น., title=SERVICE BOOKING}], message={"th_data":{"date":"Wednesday, September 21, 2016","time":"3:19 pm","type":"บริการแบบ A","branch":"ศูนย์บริการภูเก็ต"},"th":"รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริการที่ TSL Auto Service ในวันที่ 21\/09\/2016 เวลา 15:19:00 น.","en_data":{"date":"Wednesday, September 21, 2016","time":"3:19 pm","type":"Service A","branch":"Phuket Service Center"},"en":"Date confirm 21\/09\/2016 Time 15:19:00"}, collapse_key=com.socket9.thetsl}]
10-18 23:58:21.173 25945-26010/com.socket9.thetsl I/MyGcmListenerService: รถยนต์หมายเลขทะเบียน ปดก-2558 ได้นัดหมายเข้าใช้บริกา
@ripzery
ripzery / build.gradle (App's level)
Last active Jul 6, 2016
Reference for gradle-play-publisher configuration
View build.gradle (App's level)
apply plugin: 'com.android.application'
apply plugin: 'com.github.triplet.play'
android {
signingConfigs {
release {
keyAlias 'keystore'
keyPassword 'password'
storeFile file('../keystore.jks')
storePassword 'password'
@ripzery
ripzery / build.gradle (Project's level)
Last active Jul 6, 2016
Reference for config gradle-play-publisher
View build.gradle (Project's level)
buildscript {
ext.kotlin_version = '1.0.3'
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.github.triplet.gradle:play-publisher:1.1.4'
}
}
You can’t perform that action at this time.