Skip to content

Instantly share code, notes, and snippets.

View NLKNguyen's full-sized avatar

Nikyle Nguyen NLKNguyen

View GitHub Profile
@NLKNguyen
NLKNguyen / Open web page via web browser
Last active August 29, 2015 14:08
Android/Java snippet
Intent openBrowserIntent = new Intent(Intent.ACTION_VIEW);
openBrowserIntent.setData(Uri.parse("http://google.com"));
startActivity(openBrowserIntent);
@NLKNguyen
NLKNguyen / Open AlertDialog
Created November 1, 2014 19:13
Android/Java snippet
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("Are you sure?");
builder.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
dialogInterface.dismiss();
// Do something
// ...
@NLKNguyen
NLKNguyen / Ubuntu install kernel -dbgsym
Last active March 24, 2022 00:25
Ubuntu - Install Debug Symbol Package (-dbgsym) for the current Linux kernel
codename=$(lsb_release -c | awk '{print $2}')
sudo tee /etc/apt/sources.list.d/ddebs.list << EOF
deb http://ddebs.ubuntu.com/ ${codename} main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-security main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-updates main restricted universe multiverse
deb http://ddebs.ubuntu.com/ ${codename}-proposed main restricted universe multiverse
EOF
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ECDCAD72428D7C01
sudo apt-get update
@NLKNguyen
NLKNguyen / Instruction.md
Last active August 29, 2015 14:24
Make Capslock key as Additional ESC in Ubuntu

sudo apt-get install gnome-tweak-tool -y && gnome-tweak-tool

screenshot

@NLKNguyen
NLKNguyen / Installation.md
Last active September 6, 2023 11:20
Work with PlantUML on Ubuntu

Require java

Install Graphviz

$ sudo apt-get install graphviz

Download plantuml.jar

Store in for example ~/java/plantuml.jar

@NLKNguyen
NLKNguyen / Installation.md
Created July 25, 2015 16:09
Work with Gradle on Ubuntu
sudo add-apt-repository ppa:cwchien/gradle
sudo apt-get update
sudo apt-get install gradle
@NLKNguyen
NLKNguyen / ElapsedTime.cpp
Created August 15, 2015 21:42
Qt Snippets
// Measure Elapsed Time in Nanoseconds
// #include <QElapsedTimer>
QElapsedTimer timer;
qint64 nanoSec;
timer.start();
/* ... some activity ... */
@NLKNguyen
NLKNguyen / Instruction.md
Last active September 18, 2015 21:49
JAVA: Up & Running on Ubuntu

#Install Java 8 (Oracle JDK)

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

# Check
java -version
@NLKNguyen
NLKNguyen / instruction.md
Created September 28, 2015 21:32
Tomcat Setup

From Professional Java for Web Applications page 24

Configure Tomcat for first use

Add user

In file: $TOMCAT_HOME/conf/tomcat-users.xml

Add in between <tomcat-users> and </tomcat-users>

# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->