Skip to content

Instantly share code, notes, and snippets.

View elsonwu's full-sized avatar
🎯
Focusing

Elson Wu elsonwu

🎯
Focusing
View GitHub Profile
@elsonwu
elsonwu / config
Last active June 8, 2022 13:58
Config for normal daily tools
#!/bin/bash
xcode-select --install
# homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew install \
fish \
font-devicons \
@elsonwu
elsonwu / vim.md
Last active October 5, 2020 03:31
Learn some Vim

Learn some Vim

The goal - 20% of the features covers the 80% daily usage

Why you shoud learn Vim?

  • Basically it's everywhere, only if you're using Unix/Linux/macOS.
  • Edit your confuguration on the servers.
@elsonwu
elsonwu / unity-note.md
Last active March 18, 2018 02:30
Unity 笔记

unity的物件分static 和 dynamic

  • 摘要:任何拥有collider component 的都最好加上Rigidbody
  • 细节:出于性能考虑,但没有Rigidbody 的物件都认为是static,因为unity认为该物件不需要运动,并把全部static物件cache,如果写script让其运动却不赋予RigidBody,则per frame都要重新计算全部static物件到cache,影响性能,所以赋予Rigidbody给所有运动的物体让unity cache一次所有static物件,不需要重复刷新cache
  • 参考:https://unity3d.com/learn/tutorials/projects/roll-ball-tutorial/collecting-pick-objects?playlist=17141
@elsonwu
elsonwu / mongodb_collection_sizes.js
Created January 11, 2018 07:40 — forked from joeyAghion/mongodb_collection_sizes.js
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }
@elsonwu
elsonwu / gist:c6d75757657917699c79
Created December 29, 2015 07:55
Mac sed搜索替换
LC_ALL=C sed -i '' 's/old string/new string/g' `grep -rl "keyword" ./`
@elsonwu
elsonwu / gist:4d5f5be722583364ac78
Last active December 25, 2015 03:13
ubuntu install the new MongoDB driver
sudo apt-get install libssl-dev pkg-config libsasl2-dev libpcre3-dev
sudo pecl install mongodb
<?php
$data = (object)array(
"html" => "<foo bar=\"baz\"/> &amp;",
"arabic" => "العربية al-ʿarabiyyah, IPA: [æl ʕɑrɑˈbijjɐ], or عربي ʿarabī",
"hebrew" => "עִבְרִית, Ivrit",
"chinese" => "汉语/漢語 Hanyu; 华语/華語 Huáyǔ; 中文 Zhōngwén",
"korean" => "한국어/조선말",
"japanese" => "日本語 Nihongo",
"umlauts" => "äüöãáàß",
@elsonwu
elsonwu / gist:8688a1f597ef1304eabf
Last active August 29, 2015 14:02
第三方应用验证流程

约定:

app: 代表第三方应用

server: 代表api服务器

申请token

  • 申请一个app时会得到client_id和secret_key,这个secret_key只有app和server知道
Alfred
Blender: 3D modeling tool
Caffeine
CheatSheet: 按住cmd键出现当前active窗口的快捷键
Chrome
CleanMyMac
Dash
Eudb
FileZilla
GitBook
@elsonwu
elsonwu / gist:bbdad5cf1552b192817a
Created May 10, 2014 06:56
Generate a Certificate Signing Request for Nginx
openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr