Skip to content

Instantly share code, notes, and snippets.

View quangctkm9207's full-sized avatar
✍️
writing

Quang Nguyen quangctkm9207

✍️
writing
View GitHub Profile
@quangctkm9207
quangctkm9207 / sounds.json
Last active June 27, 2019 01:37
The list of sounds
{
"sound_urls": [
"https://aromashooter-app.s3-ap-northeast-1.amazonaws.com/sounds/Hes+a+Pirate++Jack+Sparrow+(Disneys+Pirates+of+the+Caribbean+Theme).mp3",
"https://aromashooter-app.s3-ap-northeast-1.amazonaws.com/sounds/ComeAnGetYourLove.mp3",
"https://aromashooter-app.s3-ap-northeast-1.amazonaws.com/sounds/HookedOnA+Feeling.mp3"
]
}
public class SettingsFragment_PrefBinding {
@UiThread
public SettingsFragment_PrefBinding(final SettingsFragment target) {
target.editPreference = (EditTextPreference) target.findPreference(target.getString(2131427366));
target.findPreference(target.getString(2131427358)).setOnPreferenceClickListener(new OnPreferenceClickListener(){
@Override public boolean onPreferenceClick(Preference preference) {
target.onNameClick(preference);
return true;
}
public class SettingsFragment extends PreferenceFragment {
@BindPref(R.string.pref_name_key)
EditTextPreference namePreference;
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
namePreference.setSummary("Uwoah! A summary.");
}
public class SettingsFragment extends PreferenceFragment {
EditTextPreference namePreference;
@Override public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
namePreference = (EditTextPreference) findPreference(getString(R.string.pref_name_key));
namePreference.setSummary("Uwoah! A summary.");
@quangctkm9207
quangctkm9207 / README.md
Last active March 16, 2018 02:14 — forked from joyrexus/README.md
form-data vs -urlencoded

Differences between x-www-form-urlencoded and multipart/form-data in HTTP POST

Following the nice answer on stackoverflow to this question of when to use one or the other content-types for POSTing data, viz. application/x-www-form-urlencoded and multipart/form-data,

“The moral of the story is, if you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.”


The full version of Matt Bridges' answer:

@quangctkm9207
quangctkm9207 / postgres-cheatsheet.md
Created January 5, 2018 06:53 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@quangctkm9207
quangctkm9207 / build.gradle
Created February 6, 2017 09:00 — forked from jackgris/build.gradle
Example of use from Proguard, from Android Studio
buildscript {
repositories {
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT'
@quangctkm9207
quangctkm9207 / introrx.md
Created October 18, 2016 06:42 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing