Skip to content

Instantly share code, notes, and snippets.

View elegracer's full-sized avatar
a cuppa iced latte?

huangkai elegracer

a cuppa iced latte?
View GitHub Profile
sudo apt -y update
sudo apt -y upgrade
sudo apt -y install git zsh curl micro
yes | sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
chsh -c /bin/zsh
@elegracer
elegracer / convolution.h
Last active January 11, 2022 11:56
fir_filter
#pragma once
#include <string>
#include <vector>
inline std::vector<double>
convolve_1d(const std::vector<double> &_f, const std::vector<double> &_g, const std::string mode) {
if (_f.empty() || _g.empty()) {
return {};
}
@elegracer
elegracer / add.sh
Created September 24, 2020 08:06 — forked from ArseniyShestakov/add.sh
My compiler alternatives
# Cleanup old alternatives
update-alternatives --remove-all cc
update-alternatives --remove-all c++
update-alternatives --remove-all gcc
update-alternatives --remove-all g++
update-alternatives --remove-all clang
update-alternatives --remove-all clang++
update-alternatives --remove-all icc
update-alternatives --remove-all icc++
function process(files) {
var plots = document.getElementById('plots');
plots.innerHTML = '';
for (var i = 0, f; f = files[i]; ++i) {
var reader = new FileReader();
reader.onload = (function (file) {
return function (e) {
var lines = e.target.result.split(/\n/);
if (lines[0][0] == '#') {
@elegracer
elegracer / basic_chinese.tex
Created December 16, 2019 04:04
最简单的能用中文的.tex文件,用xetex编译
\documentclass{article}
\usepackage{xeCJK}
\setCJKmainfont{STSong}
\begin{document}
hello 中文
\end{document}