Skip to content

Instantly share code, notes, and snippets.

View leinardi's full-sized avatar

Roberto Leinardi leinardi

  • Munich
View GitHub Profile
Processor Information:
Vendor: GenuineIntel
CPU Family: 0x6
CPU Model: 0x3c
CPU Stepping: 0x3
CPU Type: 0x0
Speed: 3900 Mhz
8 logical processors
4 physical processors
HyperThreading: Supported
@leinardi
leinardi / gist:4c1779f0f800850724d1
Last active August 29, 2015 14:01
Steam System Info 2014-05-24
Informazioni sul processore:
Produttore: GenuineIntel
Famiglia della CPU: 0x6
Modello della CPU: 0x3c
Stepping della CPU: 0x3
Tipo di CPU: 0x0
Velocità: 3900 MHz
8 processori logici
4 processori fisici
HyperThreading: Supportato
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- RED -->
<color name="red_50">#FFEBEE</color>
<color name="red_100">#FFCDD2</color>
<color name="red_200">#EF9A9A</color>
<color name="red_300">#E57373</color>
<color name="red_400">#EF5350</color>
<color name="red_500">#F44336</color>
@leinardi
leinardi / gist:5989996
Created July 13, 2013 08:35
My Steam system info
Processor Information:
Vendor: GenuineIntel
Speed: 2301 Mhz
8 logical processors
4 physical processors
HyperThreading: Supported
FCMOV: Supported
SSE2: Supported
SSE3: Supported
SSSE3: Supported
@leinardi
leinardi / ProgressDialogFragment.java
Created October 25, 2016 12:01
Yet another ProgressDialogFragment implementation
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
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
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
@leinardi
leinardi / analytics.sh
Created March 8, 2018 12:04
Track an Event from command line to Google Analytics
#!/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)
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 {
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) }
}