Skip to content

Instantly share code, notes, and snippets.

View laixintao's full-sized avatar
📟
I live in the terminal.

laixintao

📟
I live in the terminal.
View GitHub Profile
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>HTML5 GetUserMedia Demo</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
</head>
<body>
<input type="button" title="开启摄像头" value="开启摄像头" onclick="getMedia();" /><br />
@laixintao
laixintao / Snap photo with html5.html
Created October 14, 2016 04:02
Snap photo with html5
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
@laixintao
laixintao / Git常用命令.sh
Last active August 20, 2022 06:52
一些常用的git命令 速查表
------------------------------commit------------------------------
$ git status # 检查文件当前的状态
$ git add [文件名] # 追踪新的文件
$ git diff --cached # 若要看已经暂存起来的文件和上次提交时的快照之间的差异
$ git commit -m "Story 182: Fix benchmark" # 用一行命令提交更新
$ git commit -a -m 'added new benchmarks' # 跳过add命令直接提交
$ git rm --cached log.log # 从git仓库中删除不小心追踪的文件(用于gitignore之前追踪的文件)
$ git mv file_from file_to # 移动文件/重命名文件
------------------------------branch------------------------------
@laixintao
laixintao / JavaReflection.java
Created October 17, 2016 07:24
Java的反射机制例子
package cn.lee.demo;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.TypeVariable;
public class Main {
public class Jackpot {
private static Jackpot jackpot;
private ArrayList<Bet> betHistory;
private Jackpot() {
this.betHistory = new ArrayList<Bet>();
}
public boolean addBet(Bet bet) {
this.betHistory.add(bet);
@laixintao
laixintao / autocmd.vim
Last active December 1, 2016 05:27
Vim Command.
"为不同的文件类型设置不同的空格数替换TAB
autocmd FileType php,python,c,java,perl,shell,bash,vim,ruby,cpp set ai
autocmd FileType php,python,c,java,perl,shell,bash,vim,ruby,cpp set sw=4
autocmd FileType php,python,c,java,perl,shell,bash,vim,ruby,cpp set ts=4
autocmd FileType php,python,c,java,perl,shell,bash,vim,ruby,cpp set sts=4
autocmd FileType javascript,html,css,xml set ai
autocmd FileType javascript,html,css,xml set sw=2
autocmd FileType javascript,html,css,xml set ts=2
autocmd FileType javascript,html,css,xml set sts=2
@laixintao
laixintao / tmux-keys
Created February 15, 2017 01:03
tmux快速上手
“ 将当前面板上下分屏
% 将当前面板左右分屏
x 关闭当前分屏
! 将当前面板置于新窗口,即新建一个窗口,其中仅包含当前面板
Ctrl+方向键 以1个单元格为单位移动边缘以调整当前面板大小
Alt+方向键 以5个单元格为单位移动边缘以调整当前面板大小
空格键 可以在默认面板布局中切换,试试就知道了
q 显示面板编号
o 选择当前窗口中下一个面板
@laixintao
laixintao / tmux-cheatsheet.markdown
Created February 15, 2017 02:19 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@laixintao
laixintao / tmux.conf.bak
Created June 21, 2017 14:02 — forked from Jiezhi/tmux.conf.bak
tmux configure file from 《tmux:Productive Mouse-Free Development》
# Setting the prefix from C-b to C-a
set -g prefix C-a
# Free the original Ctrl-b prefix keybinding
unbind C-b
#setting the delay between prefix and command
set -sg escape-time 1
# Ensure that we can send Ctrl-A to other apps
@laixintao
laixintao / .gitconfig
Created June 29, 2017 07:54 — forked from berngp/.gitconfig
dot.gitconfig
[user]
name = Your Name
email = your.name@mail.com
[color]
ui = true
[core]
excludesfile = ~/.gitignore_global
editor = /usr/local/bin/mvim -f