Skip to content

Instantly share code, notes, and snippets.

View kaimingguo's full-sized avatar

Kaiming Guo kaimingguo

View GitHub Profile
@kaimingguo
kaimingguo / FindSDL2.cmake
Last active April 15, 2020 19:37
CMake find SDL2 library modules
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.
#.rst:
# FindSDL2
# --------
#
# Locate SDL2 library
#
# This module defines
@kaimingguo
kaimingguo / maid.sh
Created December 10, 2019 07:26
Shell Script I Use To Automatically Clean Up My Mac. FROM: https://github.com/jgamblin/MacOS-Maid
#!/bin/bash
SECONDS=0
#Check if running as root and if not elevate
amiroot=$(sudo -n uptime 2>&1| grep -c "load")
if [ "$amiroot" -eq 0 ]
then
printf "Maid Service Require Root Access. Please Enter Your Password.\n"
sudo -v
printf "\n"
@kaimingguo
kaimingguo / Vagrantfile
Created December 6, 2019 08:33
Vagrant & VirtualBox enable serial port sample
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# ...
config.vm.provider "virtualbox" do |vb|
# ...
vb.customize ["modifyvm", :id, "--uart2", "0x2F8", 3]
# add aliases to use git-fzf method
alias git-fzf 'set arg1 = `echo \!:1* | awk '"'"'{ print $1 }'"'"'`; \\
bash -c "source ~/.config/bash/plugins/git-fzf.bash && __git_fzf_bash::$arg1" ; \\
'

Update portnsap and port distfiles server name:

cp /etc/portsnap.conf /etc/portsnap.conf.orig
sed -i "" 's|portsnap.FreeBSD.org|portsnap3.hshh.org|' /etc/portsnap.conf

Add next line into /etc/make.conf file: