Skip to content

Instantly share code, notes, and snippets.

Avatar
😀
please focus

Aha huhuang03

😀
please focus
View GitHub Profile
View terminal_config.json
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"copyFormatting": "none",
"copyOnSelect": false,
"defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
// Add custom keybindings to this array.
// To unbind a key combination from your defaults.json, set the command to "unbound".
// To learn more about keybindings, visit https://aka.ms/terminal-keybindings
"keybindings":
[
@huhuang03
huhuang03 / gist:c68fd56f6dbcd08d3eb8cf4c46862ef1
Last active Sep 18, 2020 — forked from eggfly/gist:65ff355a8326c55a7621e13384917f5a
Compile Python for Android on mac (Not Work!!!!, don not use this)
View gist:c68fd56f6dbcd08d3eb8cf4c46862ef1
#!/bin/sh
#
# This script builds & bundles Python for Android
# You'll end up with a tar.bz2 file that contains a Python distribution
#
# Requires all prerequisites to build Android on the host, and the NDK
# installed.
#
# This script creates a file python4android.tbz2. Unpack it on your device
# (into a non-noexec partition!) and enjoy.
@huhuang03
huhuang03 / aa
Created Aug 12, 2020
Android: How to remove margin/padding in Preference Screen
View aa
https://stackoverflow.com/questions/18509369/android-how-to-remove-margin-padding-in-preference-screen
Simple working solution from here.
It works across all preferences without need write to all preferences app:iconSpaceReserved="false"
Create res/values-sw360dp/values-preference.xml:
<resources xmlns:tools="http://schemas.android.com/tools">
<bool name="config_materialPreferenceIconSpaceReserved" tools:ignore="MissingDefaultResource,PrivateResource">false</bool>
<dimen name="preference_category_padding_start" tools:ignore="MissingDefaultResource,PrivateResource">0dp</dimen>
View gist:4a443be8402a0fe8a47a6a0c52ccd991
# QEmu
brew install qemu
# Home for out tests
mkdir ~/arm-emu
cd ~/arm-emu
# Download initrd and kernel
wget http://ftp.de.debian.org/debian/dists/jessie/main/installer-armel/current/images/versatile/netboot/initrd.gz
@huhuang03
huhuang03 / opencv snipts
Last active Jul 29, 2020
open use opencv snipt
View opencv snipts
cv::Mat_<cv::Vec3b>::iterrator it = image.begin<cv::Vec3b>();
cv::Mat_<cv::Vec3b>::const_iterrator it = image.begin<cv::Vec3b>();
View gist:31af25be27923897f5e910f594559000
#include <android/log.h>
#define TAG "projectname" // 这个是自定义的LOG的标识
#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,TAG ,__VA_ARGS__) // 定义LOGD类型
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,TAG ,__VA_ARGS__) // 定义LOGI类型
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN,TAG ,__VA_ARGS__) // 定义LOGW类型
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,TAG ,__VA_ARGS__) // 定义LOGE类型
#define LOGF(...) __android_log_print(ANDROID_LOG_FATAL,TAG ,__VA_ARGS__) // 定义LOGF类型
@huhuang03
huhuang03 / GitConfigHttpProxy.md
Created May 16, 2020 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy
View GitConfigHttpProxy.md

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

View repo order
repo sync -f --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
View miui_start_activity
private fun miuiPermissionIntent(context: Context): Intent {
val intent = Intent("miui.intent.action.APP_PERM_EDITOR")
intent.putExtra("extra_pkgname", context.packageName)
if (hasActivity(context, intent)) return intent
intent.setPackage("com.miui.securitycenter")
if (hasActivity(context, intent)) return intent
intent.setClassName("com.miui.securitycenter", "com.miui.permcenter.permissions.AppPermissionsEditorActivity")
return intent
View uninstall Wireshark
How do I uninstall?
1. Remove /Applications/Wireshark.app
2. Remove /Library/Application Support/Wireshark
3. Remove the wrapper scripts from /usr/local/bin
4. Unload the org.wireshark.ChmodBPF.plist launchd job
5. Remove /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist
6. Remove the access_bpf group.
7. Remove /etc/paths.d/Wireshark
8. Remove /etc/manpaths.d/Wireshark