Skip to content

Instantly share code, notes, and snippets.

View gcjyzdd's full-sized avatar

Changjie gcjyzdd

  • Netherlands
View GitHub Profile
@gcjyzdd
gcjyzdd / replace.bat
Last active September 22, 2020 11:44
Search and replace symbols using ag and sed on windows. The following example replace lightSPDs with lightSPDs_buffer
ag -l lightSPDs > output.txt
for /f %%a in (output.txt) do sed -i -e "s/lightSPDs/lightSPDs_buffer/g" %%a
del output.txt
@gcjyzdd
gcjyzdd / testVector.cpp
Created December 30, 2019 16:26
Test if vector elements's address change
// Example program
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main()
{
vector<int> a;
class Rectangle{
private:
int length;
int width;
public:
Rectangle(int l, int w): length(l), width(w){};
int area(){ return length*width;};
perimeter() { return 2*(lendth+width);};
~Rectangle(){};
}
@gcjyzdd
gcjyzdd / gist:fe627912337ef7c827eb4a8d5c62fa7e
Created October 25, 2016 13:40 — forked from allex/gist:11203573
Ubuntu 安装中文字体

环境 (Environment)

版本:Ubuntu 14.04 LTS 默认语言:English(United States)

安装 (Setup)

Debian 和 Ubuntu 下对中文支持比较好的字体有: fonts-droid、ttf-wqy-zenhei 和 ttf-wqy-microhei 等,除了文泉驿系列字体外,比较流行的免费中文字体还有文鼎提供的楷体和上海宋,包名分别是: fonts-arphic-ukai 和 fonts-arphic-uming。