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 | |
# This script will try to find the adb remote debugging port in the specified | |
# IP address and then tell adb to try to connect to it. | |
# It is useful for connecting to an android device without opening the | |
# "Wireless debugging" screen to get the IP and the random port, which is | |
# cumbersome. | |
for line in $(avahi-browse --terminate --resolve --parsable --no-db-lookup _adb-tls-connect._tcp); do | |
if [[ $line != =* ]]; then |
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
#!/bin/bash | |
if [ $1 == "1" ]; then | |
echo "start proxy on 127.0.0.1:8888" | |
adb reverse tcp:8888 tcp:8888 | |
adb shell settings put global http_proxy 127.0.0.1:8888 | |
adb shell settings put global https_proxy 127.0.0.1:8888 | |
else | |
echo "stop proxy on 127.0.0.1:8888" | |
adb reverse --remove tcp:8888 |
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 SchoolViewHolder extends RecyclerView.ViewHolder { | |
private ItemSchoolBinding binding; | |
// @VisibleForTesting | |
// protected EventBus eventBus = EventBus.getDefault(); | |
private EventBus eventBus; | |
public SchoolViewHolder(@NonNull View itemView) { |
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
// IMPORTANT! READ THIS FIRST | |
// Assisted Injection doesn't work with @HiltViewModel or @ViewModelInject | |
// Read more about the issue here: https://github.com/google/dagger/issues/2287 | |
// | |
// | |
// AssistedInject and Hilt working together in v2.28-alpha times | |
// Example of a ViewModel using AssistedInject injected in a Fragment by Hilt | |
// As AssistedInject isn't part of Dagger yet, we cannot use in | |
// conjuction with @ViewModelInject |
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
#Native Instruments software uses PORT 5562 ON TCP (NTKDaemon) | |
#Run CMD as Administrador and write: | |
netstat -ano | findstr :5563 | |
taskkill /PID <PID> /F |
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
// Koneksi.php | |
<?php | |
class Koneksi { | |
private $SERVER = "localhost"; | |
private $DATABASE = "contoh_test"; | |
private $USERNAME = "root"; | |
private $PASSWORD = ""; | |
private $koneksi; | |
public function __construct() { |
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
#!/bin/sh | |
# Reset Parallels Desktop's trial and generate a casual email address to register a new user | |
rm /private/var/root/Library/Preferences/com.parallels.desktop.plist /Library/Preferences/Parallels/licenses.xml | |
jot -w pdu%[email protected] -r 1 |
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
[alias] | |
# Basically `log --oneline --decorate --graph` with different colors and some additional info (author and date) | |
lg = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)' | |
# lg (see above) with --first-parent | |
lgp = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C(reset) %C(dim black)%d%C(reset)' --first-parent | |
# https://stackoverflow.com/questions/61510067/show-specific-commits-in-git-log-in-context-of-other-commits | |
hl = "!f() { cd -- ${GIT_PREFIX:-.}; grep --color -E \"$(git log --pretty=%h \"$@\" | tr '\n' '|')\" || true; }; f" | |
hlp = "!f() { cd -- ${GIT_PREFIX:-.}; less -R -p $(git log --pretty=%h \"$@\" | tr '\n' '|'); }; f" |
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
# after appcleaner does his magic, do this | |
sudo rm -rf "/Library/Application Support/Paragon Software/" | |
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist | |
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist | |
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist | |
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist | |
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/ | |
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer | |
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/ |
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 sys, os, shutil | |
def generateClass(directory, classNumber, methodsPerClass, mainPackage): | |
className = "Foo" + str(classNumber) | |
filePath = os.path.join(directory, className + ".java") | |
with open(filePath,"w+") as f: | |
f.write("package " + mainPackage + "." + directory + ";\n") | |
f.write("public class " + className + " {\n") | |
for i in xrange(0, methodsPerClass): | |
f.write("public void foo" + str(i) + "(){\n") |
NewerOlder