Skip to content

Instantly share code, notes, and snippets.

View quangson91's full-sized avatar
🎯
Focusing

QuangSon quangson91

🎯
Focusing
  • Freedom
  • Earth
View GitHub Profile
@quangson91
quangson91 / spring boot debug in docker
Created July 1, 2017 03:42 — forked from gokman/spring boot debug in docker
spring boot debug in docker
# create spring boot container
docker run -d -e "JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n"
-p 8081:8081
-p 5005:5005
--name <container name> <image name>
# create debug configuration in intellij
go Run/Debug Configurations
click + button
choose Remote
@quangson91
quangson91 / to_png.sh
Created November 30, 2016 23:52 — forked from rafaelrinaldi/to_png.sh
Convert .psd files to .png files keeping the transparency.
#!/usr/bin/env bash
#
# Convert .psd files to .png files keeping the transparency.
# It uses `imagemagick` library.
# Usage:
#
# sh to_png.sh path/
#
# Author: Rafael Rinaldi (rafaelrinaldi.com)
@quangson91
quangson91 / start_docker_socket.sh
Created October 4, 2016 01:05
API URL for docker-mac & intellij
socat TCP-LISTEN:2375,reuseaddr,fork,bind=localhost UNIX-CONNECT:/var/run/docker.sock &
echo "Usage: tcp://localhost:2375 for binding API URL"
echo "You can check this link for more detail: https://youtrack.jetbrains.com/issue/IDEA-153973"
@quangson91
quangson91 / AndroidRecord.sh
Created September 14, 2016 07:53 — forked from FriendlyTester/AndroidRecord.sh
BASH script to record Android display and download/delete the video
#Check if an argument was supplied
if [ -z "$1" ]
then
echo "No argument supplied, please provide video name"
else
# start recording
adb shell screenrecord --bit-rate 6000000 /sdcard/$1.mp4 &
# Get its PID
PID=$!
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@quangson91
quangson91 / BingSpeechApi.java
Last active July 3, 2016 15:48
Demo bing speech api for ANDROID.
package com.vnzit.testbingspeechapi;
import com.google.gson.Gson;
import org.apache.commons.io.IOUtils;
import java.io.InputStream;
import java.util.concurrent.TimeUnit;
import okhttp3.FormBody;
@quangson91
quangson91 / android_screencapture.sh
Created June 27, 2016 10:04
Android capture screenshot with adb
PREFIX="android_screenshot"
if [ $# -gt 0 ]
then
PREFIX=$1
fi
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/Downloads/${PREFIX}_$(date +'%Y-%m-%d_%H-%M-%S').png
@quangson91
quangson91 / jenikns_ci_on_osx.md
Created June 2, 2016 06:35 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@quangson91
quangson91 / Android Lollipop Widget Tinting Guide
Created October 7, 2015 06:02 — forked from seanKenkeremath/Android Lollipop Widget Tinting Guide
How base colors in Lollipop apply to different UI elements
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix.
All Clickable Views:
-----------
* ripple effect (Lollipop only) -- "colorControlHighlight"
Status Bar:
------------
* background (Lollipop only) - "colorPrimaryDark"
@quangson91
quangson91 / 1MarkerAnimation.java
Last active August 29, 2015 14:27 — forked from broady/1MarkerAnimation.java
Animating Markers
/* Copyright 2013 Google Inc.
Licensed under Apache 2.0: http://www.apache.org/licenses/LICENSE-2.0.html */
package com.example.latlnginterpolation;
import android.animation.ObjectAnimator;
import android.animation.TypeEvaluator;
import android.animation.ValueAnimator;
import android.annotation.TargetApi;
import android.os.Build;