This file contains hidden or 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
package pattern1; | |
import java.util.HashMap; | |
import java.util.HashSet; | |
import java.util.Set; | |
import java.util.UUID; | |
/** | |
* Created by cattaka on 17/07/04. | |
* <p> |
This file contains hidden or 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
package pattern2; | |
import java.util.*; | |
/** | |
* Created by cattaka on 17/07/04. | |
* <p> | |
* Gist for https://twitter.com/Kory__3/status/882212409967919104 | |
*/ | |
public abstract class MyCacheMap<K, V> { |
This file contains hidden or 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
package pattern3; | |
import java.util.*; | |
import java.util.function.Supplier; | |
/** | |
* Created by cattaka on 17/07/04. | |
* <p> | |
* Gist for https://twitter.com/Kory__3/status/882212409967919104 | |
*/ |
This file contains hidden or 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
package pattern4; | |
import java.util.*; | |
import java.util.function.Supplier; | |
/** | |
* Created by cattaka on 17/07/04. | |
* <p> | |
* Gist for https://twitter.com/Kory__3/status/882212409967919104 | |
*/ |
This file contains hidden or 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
# Acer | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0660", GROUP="plugdev" | |
# ASUS | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0660", GROUP="plugdev" | |
# Dell | |
SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0660", GROUP="plugdev" | |
# Foxconn | |
SUBSYSTEM=="usb", ATTR{idVendor}=="0489", MODE="0660", GROUP="plugdev" | |
# Fujitsu | |
SUBSYSTEM=="usb", ATTR{idVendor}=="04c5", MODE="0660", GROUP="plugdev" |
This file contains hidden or 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/share/X11/xorg.conf.d/70-synaptics.conf | |
Section "InputClass" | |
Identifier "touchpad catchall" | |
Driver "synaptics" | |
MatchIsTouchpad "on" | |
# This option is recommend on all Linux systems using evdev, but cannot be | |
# enabled by default. See the following link for details: | |
# http://who-t.blogspot.com/2010/11/how-to-ignore-configuration-errors.html | |
# MatchDevicePath "/dev/input/event*" |
This file contains hidden or 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
#!/bin/sh | |
if [ -z "$1" ]; then | |
echo "USAGE: dumphprof <package_name> [<out_file>]" | |
exit 1 | |
fi | |
date=`date '+%Y%m%d%H%M%S'` | |
temp_file="$1_${date}_orig.hprof" | |
output_file="$1_${date}.hprof" |
This file contains hidden or 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
CREATE TEMPORARY FUNCTION GET_PARAMS_FROM_QUERY_STRING(query_str STRING, key_name STRING) | |
RETURNS STRING | |
LANGUAGE js AS """ | |
if (query_str == null) { return null; } | |
var start = 0; | |
while (0 <= start && start < query_str.length) { | |
var end = query_str.indexOf('&', start + 1); | |
if (end < 0) { end = query_str.length } | |
var p = query_str.indexOf('=', start); |
This file contains hidden or 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
#include<BLEDevice.h> | |
#include<BLEHIDDevice.h> | |
BLEServer* gBLEServer; | |
BLEHIDDevice* gBLEHIDDevice; | |
BLECharacteristic* gBLECharacteristic; | |
class MyServerCallbacks: public BLEServerCallbacks { | |
public: |
This file contains hidden or 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
# Replace all keybind of IntelliJ (including android studio) | |
# meta <> control | |
# | |
# How to use | |
# | |
# extract original keymaps from resource.jar | |
# $ unzip $PATH_TO_INTELLI_J/lib/resources.jar keymaps/\* | |
# $ python android_studio_swap_key.py -i keymaps/Mac\ OS\ X\ 10.5+.xml -o swapped.xml | |
import xml.etree.ElementTree as ET |