Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing on work

見える biezhi

🎯
Focusing on work
View GitHub Profile
@biezhi
biezhi / QRterminal.java
Last active Jun 6, 2019
Java二维码输出到控制台,需引入 zing 库,颜色代码见 https://gist.github.com/zfkun/9755885
View QRterminal.java
import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.common.BitMatrix;
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import java.util.Hashtable;
@biezhi
biezhi / git_upstream.md
Last active Jun 2, 2019
保持fork之后的项目和上游同步
View git_upstream.md

开源协作,为了规范,一般都是 fork 别人的仓库到自己帐号下,再提交pr,原始仓库一直保持更新,下面介绍如何保持自己fork之后的仓库与上游仓库同步。

下面以我 fork Blade 仓库为例

点击 fork 到自己帐号下,然后就可以在自己的帐号下 clone 相应的仓库

使用 git remote -v 查看当前的远程仓库地址,输出如下:

origin  git@github.com:biezhi/blade.git (fetch)
@biezhi
biezhi / character.md
Last active Jun 1, 2019
HTML字符实体(Character Entities),转义字符串(Escape Sequence)
View character.md
<title>常用HTML转义字符,html转义符,JavaScript转义符,html转义字符表,HTML语言特殊字符对照表(ISO Latin-1字符集) - 来源:嘻嘻网 114.xixik.com</title> <style type="text/css" media="screen">
@biezhi
biezhi / yaofan.md
Last active Mar 22, 2019
搭建要饭网站教程
View yaofan.md

小哥哥一起来要饭

演示站点 https://yaofan.2333.blog

需要环境

  1. 推荐 CentOS7 + Python2.7
  2. 一个域名
  3. 注册有赞和有赞云个人开发者
  4. 创建店铺并获取密钥信息
View zshrc
# I you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/biezhi/.dotfiles/zsh
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
#ZSH_THEME="robbyrussell"
#ZSH_THEME="ys"
@biezhi
biezhi / mysql_back.sh
Created Apr 24, 2018
在 Linux 上定时备份 MySQL 数据库,并发送备份到邮件
View mysql_back.sh
#!/bin/sh
#this is the prefix before the filename and can be anything you want
fileprefix='mysql_backup_';
#this is your mysql user - best to create a new mysql user called backup that has access to all databases
myuser='backup';
#your mysql password
mypass='s0mething$ecure123';
@biezhi
biezhi / UrlShortener.java
Created May 29, 2018
Java 短链接生成算法
View UrlShortener.java
public class UrlShortener {
// private static final String ALPHABET = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
private static final String ALPHABET = "mUSNcOa6hDgfnEJ1rGMPC03jv4k9RIqL2Yy7TQdH8xu5XFWwAKoZVstizlepBb";
private static final int BASE = ALPHABET.length();
public static String encode(int num) {
StringBuilder sb = new StringBuilder();
while (num > 0) {
sb.append(ALPHABET.charAt(num % BASE));
View bbr+ssr.md

安装 BBR

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/bbr.sh && chmod +x bbr.sh && bash bbr.sh

使用方法

# 启动BBR
@biezhi
biezhi / github_multiple-accounts.md
Created Nov 8, 2018 — forked from JoaquimLey/github_multiple-accounts.md
How to Work with GitHub and Multiple Accounts
View github_multiple-accounts.md

Step 1 - Create a New SSH Key

We need to generate a unique SSH key for our second GitHub account.

ssh-keygen -t rsa -C "your-email-address"

Be careful that you don't over-write your existing key for your personal account. Instead, when prompted, save the file as id_rsa_COMPANY. In my case, I've saved the file to ~/.ssh/id_rsa_work.

Step 2 - Attach the New Key

You can’t perform that action at this time.