Skip to content

Instantly share code, notes, and snippets.

View oizhaolei's full-sized avatar
🏠
Working from home

lei oizhaolei

🏠
Working from home
View GitHub Profile
@oizhaolei
oizhaolei / gist:057a6938a2ddaa1d1a22
Created July 30, 2015 10:58
google-translate with http proxy
node-google-translate/lib/main.js
// Closure that returns a function for making a
// GET request to Google with an apiKey
-var getRequestWithApi = function(apiKey) {
+var getRequestWithApi = function(apiKey, httpProxy) {
return function(path, data, done) {
var url = apiBase + path + '?' + querystring.stringify(_.extend({ 'key': apiKey }, data));
+
+ if (httpProxy != '') {
@oizhaolei
oizhaolei / brewlist
Created August 25, 2018 08:15
my brew list
~ » brew list zhaolei@zhaoleis-MacBook-Pro
autoconf go nginx tldr
automake gradle node tomcat
ctags icu4c openssl tree
docker jpeg pcre unrar
docker-compose libev perl vim
docker-machine libidn2 pkg-config wget
docker-machine-driver-xhyve libtiff python xhyve
fortune libunistring python@2 xz
fzf libyaml readline zsh
@oizhaolei
oizhaolei / init-local.el
Last active March 13, 2022 13:29
config.el for purcell
;;; init-local.el --- Settings and helpers for package.el -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(setq url-proxy-services
'(("no_proxy" . "^\\(localhost\\|10.*\\)")
("http" . "localhost:55776")
("https" . "localhost:55776")))
(desktop-save-mode nil)
(set-frame-position (selected-frame) 80 0)
@oizhaolei
oizhaolei / 0 - setup
Last active September 25, 2023 11:03 — forked from aserhat/0 - setup
QEMU and HVF
# Summary
A few notes I took to see if I could use MacOS as Hypevirsor in a similar fashion to Linux
I wanted to see how few addons were needed instead of using Parallels, Virtual Box, VM Fsion etc.
The idea is to use QEMU, Hypervisor Framework (https://developer.apple.com/documentation/hypervisor) and some custom host networking.
# Installations
brew install qemu (For controlling Hypervisor Framework)
brew install cdrtools (For making cloud init iso's)
http://tuntaposx.sourceforge.net/download.xhtml (For customer tap based networking)
@oizhaolei
oizhaolei / doom.txt
Created December 8, 2021 13:29 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet
SPC
SPC: find file
, switch buffer
. browse files
: MX
; EX
< switch buffer
` eval
u universal arg
x pop up scratch