Skip to content

Instantly share code, notes, and snippets.

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

Hongde Liu enginespot

🏠
Working from home
View GitHub Profile
@enginespot
enginespot / Git: Empty branch.md
Created June 30, 2021 04:09 — forked from blattmann/Git: Empty branch.md
Git: Create empty branch

Replace empty-branch with your desired branch name.

git checkout --orphan empty-branch

Then you can remove all the files you'll have in the staging area (so that they don't get committed):

git rm -rf .

At this point you have an empty branch, on your machine.

@enginespot
enginespot / carray2slice.go
Created June 25, 2021 09:14 — forked from nasitra/carray2slice.go
Convert 'C' array to golang slice
func carray2slice(array *C.int, len int) []C.int {
var list []C.int
sliceHeader := (*reflect.SliceHeader)((unsafe.Pointer(&list)))
sliceHeader.Cap = len
sliceHeader.Len = len
sliceHeader.Data = uintptr(unsafe.Pointer(array))
return list
}
@enginespot
enginespot / lxcli_proxy.sh
Created September 4, 2017 10:53 — forked from valorad/lxcli_proxy.sh
linux command line tools use proxy
enable_proxy() {
export http_proxy="127.0.0.1:1080"
export https_proxy="127.0.0.1:1080"
}
disable_proxy() {
unset http_proxy
unset https_proxy
}
@enginespot
enginespot / git-key.md
Created April 1, 2017 04:10 — forked from yisibl/git-key.md
如何创建 Git 公钥

如何创建公钥

  1. 首先启动一个Git Bash窗口(非Windows用户直接打开终端)

  2. 执行:

    cd ~/.ssh

    如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!

@enginespot
enginespot / dev.conf
Created January 8, 2016 11:06 — forked from fnando/dev.conf
Nginx configuration for SSH tunnel
upstream tunnel {
server 127.0.0.1:3000;
}
server {
listen 80;
server_name dev.codeplane.com br.dev.codeplane.com;
location / {
proxy_set_header X-Real-IP $remote_addr;
@enginespot
enginespot / IntelliJ_IDEA__Perf_Tuning.txt
Created November 2, 2015 13:02 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@enginespot
enginespot / req.cpp
Last active August 29, 2015 14:21 — forked from anonymous/req.cpp
//Include a script file into current context
//Raise javascript exception if load failed
v8::Handle<v8::Value> _BeaScript::include( const Arguments& args )
{
boost::filesystem::path parentPath = scriptPath.parent_path();
//v8::String::Utf8Value fileName(args[i]);
std::string fileName = bea::Convert<std::string>::FromJS(args[0], 0);
//Add the script path to it
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite