Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Santino Yanz santinoyanz

🎯
Focusing
View GitHub Profile
@santinoyanz
santinoyanz / merge_dicts.py
Last active Jun 20, 2020
How to merge two dictionaries in python
View merge_dicts.py
# delcare two dicts with x and y
x = dict(a=1, b=2)
y = dict(b=2, c=5)
## in python 3.5+ ##
z = { **x, **y} # z = {'a': 1, 'b': 2, 'c': 5}
## in python 2.x ##
@santinoyanz
santinoyanz / fibo.c
Created Jun 20, 2020
Fibonacci Number
View fibo.c
int fibo(int);
int fibo(int N) {
if (0 == N) return 0;
if (1 == N || 2 == N) return 1;
int pre = 1, cur = 1;
for (int i = 3; i <= N; ++i) {
int sum = pre + cur;
pre = cur;
cur = sum;
}
View config.yml
#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/config.yml
##
## 如果您不知道如何操作,请参阅 SS-Rule-Snippet 的 Wiki:
## https://github.com/Hackl0us/SS-Rule-Snippet/wiki/clash(X)
#---------------------------------------------------#
# HTTP 代理端口
port: 7890
@santinoyanz
santinoyanz / .tmux.conf.local
Created Mar 13, 2021
customize tmux configuration with .tmux
View .tmux.conf.local
# : << EOF
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# -- navigation ----------------------------------------------------------------
# if you're running tmux within iTerm2
@santinoyanz
santinoyanz / VagrantFile
Created Mar 13, 2021
Startup centos7 quickly through vagrant (rewrite ip and network adapter)
View VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at