- [Data Structures] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#data-structures)
- [Linked Lists] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#linked-lists)
- [Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#trees)
- [Binary Trees] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-trees)
- [Binary Search Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#binary-search-tree)
- [Red-Black Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#red-black-tree)
- [AVL Tree] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#avl-tree)
- [Tries] (https://gist.github.com/lawloretienne/6f7d7d92f72986f5ebd60f226d9044ee#tries)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then | |
echo "`basename $0` - run a command spawning an Android Emulator before. It can be used to run Android Tests." | |
echo "Usage: `basename $0` COMMAND" | |
echo "Example: $ `basename $0` ./gradlew connectedPayGermanyCompatDebugAndroidTest --info" | |
exit 0 | |
fi | |
# grab some variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/lib/udev/rules.d/51-android.rules # These rules refer: https://developer.android.com/studio/run/device.html | |
# and include many suggestions from Arch Linux, GitHub and other Communities. | |
# Latest version can be found at: https://github.com/M0Rf30/android-udev-rules | |
# check the syntax of this file using: | |
# grep -v '^#' 51-android.rules \ | |
# | grep -Ev '^$' \ | |
# | grep -Ev '^SUBSYSTEM=="usb", ATTR{idVendor}=="[0-9a-f]{4}", ATTR{idProduct}=="[0-9a-f]{4}", ENV{adb_user}="yes"$' \ | |
# | grep -Ev '^SUBSYSTEM=="usb", ATTR{idVendor}=="[0-9a-f]{4}", ENV{adb_user}="yes"$' |
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:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.databinding.BaseObservable | |
import kotlin.properties.Delegates | |
fun <T> BaseObservable.dataBind(defaultValue: T, fieldId: Int, vararg fieldIds: Int, callback: ((oldValue: T, newValue: T) -> Unit)? = null) = | |
Delegates.observable(defaultValue) { _, old, new -> | |
if (old != new) { | |
callback?.invoke(old, new) | |
notifyPropertyChanged(fieldId) | |
fieldIds.forEach { notifyPropertyChanged(it) } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.annotation.SuppressLint | |
import android.text.Editable | |
import android.text.TextWatcher | |
import android.widget.EditText | |
private const val INITIAL_MONTH_ADD_ON = "0" | |
private const val DEFAULT_MONTH = "01" | |
private const val SEPARATOR = "/" | |
class TwoDigitMonthYearInputTextWatcher(val editText: EditText) : TextWatcher { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
TID="UA-XXXX-Y" # The tracking ID / web property ID. The format is UA-XXXX-Y. All collected data is associated by this ID. | |
while getopts ":a:c:l:" opt; do | |
case $opt in | |
a) | |
ACTION="$OPTARG" | |
;; | |
c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Desktop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: GenuineIntel | |
CPU Brand: Intel(R) Core(TM) i7-4770K CPU @ 3.50GHz | |
CPU Family: 0x6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SteamVR System Report created ven feb 24 22:16:24 2017 | |
<Report> | |
SteamVR Version: 1487904548 | |
SteamVR Date: 2017-02-24 | |
Steam: Public | |
Steam Branch: beta | |
Steam AppID: 250820 | |
Tracking: lighthouse | |
OS: Linux version 4.8.0-37-generic (buildd@lcy01-17) (gcc version 6.2.0 20161005 (Ubuntu 6.2.0-5ubuntu12) ) #39-Ubuntu SMP Thu Jan 26 02:27:07 UTC 2017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ProgressDialogFragment extends DialogFragment { | |
private static final String TAG = ProgressDialogFragment.class.getName(); | |
private static final String KEY_TITLE = TAG + "_message"; | |
private static final String KEY_MESSAGE = TAG + "_title"; | |
/** | |
* Create and show a ProgressDialogFragment with the given message. | |
* | |
* @param fragmentManager The FragmentManager this fragment will be added to | |
* @param message displayed message |
NewerOlder