Skip to content

Instantly share code, notes, and snippets.

View angusdev's full-sized avatar

Angus angusdev

View GitHub Profile
Option Explicit
Public Sub ModifySubject()
Dim olitem As Outlook.mailItem
Dim newSubject As String
If Application.ActiveExplorer.Selection.Count <= 0 Then
Exit Sub
End If
@angusdev
angusdev / OutlookFindFolder.vbs
Created January 27, 2022 00:59
Find a folder
Private g_Folder As Outlook.MAPIFolder
Private g_Find As String
' Source: https://www.extendoffice.com/documents/outlook/2087-outlook-find-folder-by-name.html
Public Sub FindFolder()
Dim xFldName As String
Dim xFolders As Outlook.Folders
Dim xYesNo As Integer
On Error Resume Next
Set g_Folder = Nothing
@angusdev
angusdev / React-Native-MacOS-M1.MD
Last active January 31, 2021 14:17
React Native development in MacOS M1

Basic

  • Not all native libraries support arm64, so only build for x86_64 architecture
    • Use arch -x86_64 pod in command line to force using x86_64
    • Config in Xcode to build on x86 only, do below in both your project and Pods project
      • in Build Settings -> Build Active Architecture Only, set to Yes
      • in Build Settings -> Exclude Architectures, add arm64
    • Needs to config the Pods project again after run pod install
  • Commons build errors for incorrect architecture:
@angusdev
angusdev / React-Native-Android-Windows.MD
Last active February 9, 2021 04:21
Setup React Native Android in Windows

Install Nodejs

  • Download and install from https://nodejs.org/en/download/
  • run nodevars.bat to setup the environment
    • set NODE_SKIP_PLATFORM_CHECK=1 if you are not runner Windows 10
    • or add in nodevars.bat
  • Install Yarn
    • npm install --global yarn
  • Install React Native
    • yarn add global react-native
@angusdev
angusdev / chi-comm-code.sql
Created September 27, 2019 03:20
Convert Chinese characters to telecode / 中文電碼 / 中文电码
drop table CHI_COMM_CODE
/
create table CHI_COMM_CODE (UNICODE varchar2(3) primary key, COMM_CODE_TC varchar2(4), COMM_CODE_SC varchar2(4))
/
insert into CHI_COMM_CODE values ('倀', '0210', '');
insert into CHI_COMM_CODE values ('倂', '0164', '');
insert into CHI_COMM_CODE values ('倅', '0211', '');
insert into CHI_COMM_CODE values ('倆', '0224', '');
@angusdev
angusdev / email.vbs
Created November 23, 2018 01:32
VBScript to automatically send email with attachments
' Command Line:
' email.vbs [config] [action]
'
' action: optional, "send" will automaically send the email, leave blank to display the message
' Config File
' Line 1: To, separated by ;
' Line 2: Cc, separated by ;, can be empty
' Line 3: Subject
' Line 4: Attachment Directory, can be empty
' Line 5: Blank line
@angusdev
angusdev / m.bat
Created November 20, 2018 04:15
Search for matching files and call another command with the filename
@echo off
REM m.bat foo*.txt
REM search recursively the first match of foo*.txt and call n.bat with the file name
REM m.bat foo*.txt 3
REM search recursively foo*.txt and call n.bat with the file name, maximum 3 instances
REM m.bat foo.txt
REM DO NOT USE without wildcard, it will call the n.bat with the filename, no matter file exist or not
set "m=%~2"
import java.io.IOException;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
// https://stackoverflow.com/questions/1286461/can-i-find-the-console-width-with-java
public class GuessConsoleWidth {
public static void main(String[] args) {
System.out.println("Guess Cosnole Width = " + guessConsoleWidth());
}
@angusdev
angusdev / eclipse-openjdk10.MD
Created July 31, 2018 09:20
Running Eclipse on OpenJDK10, utilizing Application Class Data Sharing