Skip to content

Instantly share code, notes, and snippets.

View banjin's full-sized avatar
🏠
Working from home

songhm banjin

🏠
Working from home
View GitHub Profile
@banjin
banjin / vue_validation.js
Created August 11, 2016 10:59 — forked from pulading1988/new_gist_file.js
vue.js写的一个表单验证示例
var mobileRE = /^(((13[0-9]{1})|(14[57]{1})|(15[0-9]{1})|(17[678]{1})|(18[0-9]{1}))+\d{8})$/;
var passwordRE = /^[A-Za-z0-9]{6,20}$/;
var BASE_PATH = '${basePath}';
var j_captchaUrl = '${basePath}/jcaptcha'; // 获取验证码的后端地址
var app = new Vue({
el: '#app',
data: {
mobile: '',
j_captcha: '',
@banjin
banjin / git_toturial
Last active January 25, 2018 03:52 — forked from guweigang/git_toturial
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@banjin
banjin / socket 基础
Last active July 18, 2018 09:42
记录 socket 编程
Python Socket 编程详细介绍
Python 提供了两个基本的 socket 模块:
Socket 它提供了标准的BSD Socket API。
SocketServer 它提供了服务器重心,可以简化网络服务器的开发。
下面讲解下 Socket模块功能。
Socket 类型
套接字格式:socket(family, type[,protocal]) 使用给定的套接族,套接字类型,协议编号(默认为0)来创建套接字
@banjin
banjin / kennethreitz.zsh-theme
Created September 15, 2018 03:29 — forked from kennethreitz/kennethreitz.zsh-theme
"kennethreitz" theme for oh-my-zsh. Designed for Operator Mono. Supports virtualenvs & git.
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
PROMPT='$(virtualenv_prompt_info)%{%}%{$fg[green]%}%c \
$(git_prompt_info)\
\
%{$fg[red]%}%(!.#.»)%{$reset_color%} '
PROMPT2='%{$fg[red]%}\ %{$reset_color%}'
RPS1='%{$fg[blue]%}%~%{$reset_color%} ${return_code} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$reset_color%}%{$fg[yellow]%}("
@banjin
banjin / wtf Python
Last active November 29, 2018 02:31
记录一些让人懵逼的现象
1. python2
>>> 'a' * 20 is 'aaaaaaaaaaaaaaaaaaaa'
True
>>> 'a' * 29 is 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
False
>>> 'a' * 21 is 'aaaaaaaaaaaaaaaaaaaaa'
False
python3
@banjin
banjin / MySQL_5-7_macOS.md
Created January 12, 2019 14:09 — forked from robhrt7/MySQL_5-7_macOS.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@banjin
banjin / Linux 常用命令
Last active January 18, 2019 01:49
记录一些linux的常用命令
系统
# uname -a # 查看内核/操作系统/CPU信息
# head -n 1 /etc/issue # 查看操作系统版本
# cat /proc/cpuinfo # 查看CPU信息
# hostname # 查看计算机名
# lspci -tv # 列出所有PCI设备
# lsusb -tv # 列出所有USB设备
# lsmod # 列出加载的内核模块
# env # 查看环境变量
@banjin
banjin / zeromq的几种模式
Created January 18, 2019 05:58
记录几种zmq的实现模式
Request-Reply模式:
server端:
#!/usr/bin/env python
# -*- coding=utf-8 -*-
import zmq
import random
# Ubuntu
sudo apt-get -y install git gcc make libpcap-dev
git clone https://github.com/robertdavidgraham/masscan
cd masscan/
make
sudo make install
@banjin
banjin / .gitconfig
Created October 22, 2019 10:07
默认gitconfig配置
1 [user]
2 email = ''
3 name = ''
4 emal = ''
5 [core]
6 excludesfile = ~/.gitignore_global
7 [difftool "sourcetree"]
8 cmd = opendiff \"$LOCAL\" \"$REMOTE\"
9 path =