Skip to content

Instantly share code, notes, and snippets.

View pwxcoo's full-sized avatar
🐟

Xiance Wu pwxcoo

🐟
View GitHub Profile
@pwxcoo
pwxcoo / profile.ps1
Last active August 26, 2019 14:11
my customized powershell profile
# http://joonro.github.io/blog/posts/powershell-customizations.html
Import-Module PSReadLine
# Oh-My-Posh https://github.com/pecigonzalo/Oh-My-Posh
Import-Module "Oh-My-Posh" -DisableNameChecking -NoClobber
Set-PSReadLineOption -HistoryNoDuplicates
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineOption -HistorySaveStyle SaveIncrementally
Set-PSReadLineOption -MaximumHistoryCount 4000
# history substring search
@pwxcoo
pwxcoo / huffman.cpp
Created July 14, 2019 13:56
huffman encoding implemented by c++
#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
using namespace std;
// A Tree node
struct Node
{
char ch;
@pwxcoo
pwxcoo / javap.java
Last active June 14, 2021 03:36
javap 指令集
栈和局部变量操作
将常量压入栈的指令
aconst_null 将null对象引用压入栈
iconst_m1 将int类型常量-1压入栈
iconst_0 将int类型常量0压入栈
iconst_1 将int类型常量1压入栈
iconst_2 将int类型常量2压入栈
iconst_3 将int类型常量3压入栈
iconst_4 将int类型常量4压入栈
iconst_5 将int类型常量5压入栈
@pwxcoo
pwxcoo / fix-touchpad.sh
Created June 18, 2019 01:49
fix touchpad in ubuntu
# https://askubuntu.com/questions/970988/two-finger-scrolling-not-working-for-ubuntu-17-10
sudo modprobe -r psmouse
sudo modprobe psmouse
@pwxcoo
pwxcoo / LRUCache.java
Last active June 18, 2019 01:17
LRU implemented with LinkedHashMap in Java
import java.util.LinkedHashMap;
import java.util.Map;
public class LRUCache<K, V> extends LinkedHashMap<K, V> {
private int cacheSize;
public LRUCache(int cacheSize) {
super((int) Math.ceil(cacheSize / 0.75) + 1, 0.75f, true);
@pwxcoo
pwxcoo / fraction.cpp
Last active February 14, 2023 00:02
Fraction implement by C++
#include <cstdio>
#include <cstring>
#include <iostream>
#include <stdexcept>
using namespace std;
class Fraction {
int numerator;
int denominator;
@pwxcoo
pwxcoo / merge_lines.sh
Last active June 18, 2019 01:19
merge many lines to one line with delimeter
shuf -i 1-100 | paste -sd "," -
@pwxcoo
pwxcoo / random_emoji.sh
Last active June 18, 2019 01:20
random emoji
emojify -l | shuf -n 1 | cut -d ' ' -f 2
@pwxcoo
pwxcoo / repair.sh
Last active June 18, 2019 01:21
ubuntu 的 ibus 输入法不能按数字键取词
rm -rf ~/.cache/ibus/libpinyin
ibus restart
@pwxcoo
pwxcoo / jt.sh
Last active December 16, 2018 10:44
my jupyter theme configuration
jt -t grade3 -fs 115 -tfs 11 -nfs 115 -cellw 88% -T -f ubuntu -ofs 115