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 / solution.md
Created February 3, 2021 08:51 — forked from lgg/solution.md
JetBrains intellij idea + NVM + nodejs + WebStorm

NVM + WebStorm

If you get error:

run npm command gives error "/usr/bin/env: node: No such file or directory

in file watcher

@quangson91
quangson91 / export-to-csv.gs
Created April 4, 2019 02:20 — forked from mderazon/export-to-csv.gs
Google apps script to export to individual csv files all sheets in an open spreadsheet
/*
* script to export data in all sheets in the current spreadsheet as individual csv files
* files will be named according to the name of the sheet
* author: Michael Derazon
*/
function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
ss.addMenu("csv", csvMenuEntries);
api=28
branch=android-9.0.0_r3
mkdir android-sdk-source-build
cd android-sdk-source-build
mkdir -p frameworks/base
# Fetch repositories that contain the sources we're interested in
git clone --depth 1 https://android.googlesource.com/platform/frameworks/base -b $branch frameworks/base
@quangson91
quangson91 / pr.md
Created June 6, 2018 01:40 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@quangson91
quangson91 / ExampleApplication.java
Created January 3, 2018 03:55 — forked from pepyakin/ExampleApplication.java
Gist which should prevent leaks of Activity in ClipboardUIManager.
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
try {
Class<?> cls = Class.forName("android.sec.clipboard.ClipboardUIManager");
Method m = cls.getDeclaredMethod("getInstance", Context.class);
Object o = m.invoke(null, this);
} catch (Exception ignored) { }
}
}
1. Setup a project
2. Add groovy SDK support:
https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA
3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl
- this will give you the .gdsl file - download this to the src folder of your project.
4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root
@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 / 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>