Skip to content

Instantly share code, notes, and snippets.

@qh-huang
qh-huang / delete_non-code_files.py
Last active July 24, 2023 11:39
Trim tools for large code base trim to avoid massive processing time for other software to process
#!/usr/bin/env python3
import os
import sys
from tqdm import tqdm # Import tqdm for the progress bar
def is_code_file(file_path):
code_file_names = {"Makefile", "configure", "Kconfig", ".gitignore", ".gitmodules", "CMakeFile"} # Add more conventional file names as needed
code_file_extensions = {".c", ".cc", ".cpp", ".h", ".hh", ".hpp", ".inc", ".java", ".dts", ".dtsi", ".log", ".conf",
".ini", ".xml", ".yaml", ".xls", ".csv", ".js", ".py", ".s", ".gitmodules", ".cmake", ".gn", ".md", ".m4", ".m", ".diff",
1. 10 秒規則
花 10 ~ 20 秒瀏覽你的履歷,假裝你對你所使用的技術或術語一無所知。
想想它描繪了關於這個人的什麼畫面。
如果你申請的是軟件工程師的職位,不要使用“聯合投資人”或任何其他不相關的頭銜。
Take a 10~20 seconds glance to your resume and pretending you know nothing about the technology or terms you're using. Think of what picture it paints about this person.
If you're applying a role of software engineer, take off "co-fundder" or any other unrelevant titles.
@qh-huang
qh-huang / firefox_docker.sh
Created May 19, 2019 17:54 — forked from mreichelt/firefox_docker.sh
Run Firefox in Docker image on Mac with X11 forwarding to XQuartz
#!/bin/bash
# allow access
xhost +
# run firefox with X11 forwarding and keep running until it quits
docker run -e DISPLAY=host.docker.internal:0 jess/firefox
@qh-huang
qh-huang / ubuntu
Last active October 3, 2018 05:15
OS install
# General
sudo apt-get update
sudo apt-get install -y \
git gitk gitweb lighttpd \
cmake \
curl \
openssh-server \
vim \
tmux \
tree \
@qh-huang
qh-huang / include
Last active October 3, 2018 06:27
QtCreator settings
# xenial (ubuntu 16.04)
/usr/include/c++/5
/usr/include/c++/5.4.0
/usr/include/eigen3
/usr/include/pcl-1.7
/usr/local/include/ceres
/opt/ros/kinetic/include
# bionic (ubuntu 18.04)
/usr/include/c++/7
@qh-huang
qh-huang / cloudSettings
Last active November 11, 2019 11:16
Visual Studio Code Settings Sync Gist_20191111
{"lastUpload":"2019-11-11T11:14:00.196Z","extensionVersion":"v3.4.3"}

改編自 Effective Engineer (https://gist.github.com/rondy/af1dee1d28c02e9a225ae55da2674a6f)

原文已經是文摘了,取自 Effective Engineer (http://www.effectiveengineer.com/)

有鑒於 1)它是英文 以及 2)文章太長,實在不利傳播,所以一直想要翻譯+濃縮這篇,分享給台灣的工程師(我認為不只工程師,所有知識工作者都適用

翻譯的同時,也加入自己的理解,所以可能和原文有出入,有疑義可參考原文。 (由於筆者是軟體工程師,所以舉例的部分都會偏向科技業和軟體工程)

  • 目標讀者

FWIW: I didn't produce the content present here. I've just copy-pasted it from somewhere over the Internet, but I cannot remember exactly the original source. I was also not able to find the author's name, so I cannot give him/her the proper credit.


Effective Engineer - Notes

What's an Effective Engineer?

#include <stdio.h>
#include <string.h>
void swap(char* a, char* b)
{
*a ^= *b;
*b ^= *a;
*a ^= *b;
}
@qh-huang
qh-huang / jni_commonly_used_code.cpp
Last active October 20, 2023 08:54
JNI useful code pieces
// ==================== pull from Facebook/rockdb@github ====================
class ListJni {
public:
// Get the java class id of java.util.List.
static jclass getListClass(JNIEnv* env) {
jclass jclazz = env->FindClass("java/util/List");
assert(jclazz != nullptr);
return jclazz;
}