Skip to content

Instantly share code, notes, and snippets.

View ericosur's full-sized avatar

ericosur ericosur

  • Taipei
  • 01:27 (UTC +08:00)
View GitHub Profile
@ericosur
ericosur / run_test.sh
Last active August 2, 2024 00:55
a bash script that use ImageMagick
#!/bin/bash
# for i in {1..8} ; do
# DST=bike${i}.jpg
# /usr/bin/cp -f bike.jpg ${DST}
# exiftool -n -Orientation=$i ${DST}
# done
# for i in {1..8} ; do
# SRC=bike${i}.jpg
@ericosur
ericosur / WinHelper.java
Last active July 31, 2024 07:39
To hide navigation bar for android app
/*
* class WinHelper
*/
import android.app.Activity;
import android.view.View;
import android.view.WindowInsets;
import android.view.WindowInsetsController;
class WinHelper {
public static void hideNavigationBar(Activity act) {
@ericosur
ericosur / cygwin-no-admin.bat
Created November 15, 2022 02:12
run cygwin installer without admin permission
@echo off
rem it is useful for me to install cygwin on a windows machine without admin permission
setup-x86_64.exe --no-admin
@ericosur
ericosur / VSCode.md
Created November 21, 2021 06:30 — forked from anonymous1184/VSCode.md
AHK Debugging with Visual Studio Code

AHK Debugging with Visual Studio Code

Guide created on 11/03/21 with VSCode version 1.53 (stable). Last tested with version 1.62.2.

I'm not a native English speaker, so please report inconsistencies to [/u/anonymous1184][00] (or send a .patch of the [source][01]).

Table of Contents

  1. TL;DR: 5min Cookbook Recipe
  2. Choosing a Version
@ericosur
ericosur / AdbCommands
Created June 5, 2021 22:03 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@ericosur
ericosur / querySystemFeatures.java
Last active April 9, 2021 06:27
query system features from package manager
import android.content.pm.PackageManager;
import android.content.pm.FeatureInfo;
import android.util.Log;
// $ adb shell pm list features
private void querySystemFeatures() {
static final String APP_TAG = "app_tag";
final PackageManager pm = getPackageManager();
final FeatureInfo[] featuresList = pm.getSystemAvailableFeatures();
String feature_string = "";
@ericosur
ericosur / crop_roi.cpp
Last active March 8, 2021 09:05
opencv crop ROI of an image
// You mention that you start with a CVMat* imagesource
CVMat * imagesource;
// Transform it into the C++ cv::Mat format
cv::Mat image(imagesource);
// Setup a rectangle to define your region of interest
cv::Rect myROI(10, 10, 100, 100);
// Crop the full image to that image contained by the rectangle myROI
@ericosur
ericosur / SimpleVibrateDemoActivity.java
Created January 18, 2021 09:09 — forked from nieldeokar/SimpleVibrateDemoActivity.java
Android Vibrate & VibrationEffect class demo Usage
package com.example.nileshdeokar.simplevibratedemo;
import android.os.Build;
import android.os.VibrationEffect;
import android.os.Vibrator;
import android.support.annotation.RequiresApi;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;
/*
@ericosur
ericosur / n.py
Created December 29, 2020 07:42
sum using python vanilla or numpy
#!/usr/bin/python3.6
# coding: utf-8
'''
brief description for this script
'''
import time
import numpy as np
#!/usr/bin/env python3
# coding: utf-8
s = '❤️🇧🇴🙋‍♀️🏈😃'
print(s)
line = '"'
for cc in s:
hx = hex(ord(cc)) # str, 0x1f1e7
hx = hx.upper()