Skip to content

Instantly share code, notes, and snippets.

View Sebastian1011's full-sized avatar
🗯️

Sebastian Zhang Sebastian1011

🗯️
View GitHub Profile
@Sebastian1011
Sebastian1011 / fomat.py
Last active December 1, 2023 05:49
format image python script( use python and ffmpeg
#!/usr/bin/python
#coding=utf-8
import os
import sys
import re
def readFile(filePath):
allFiles = os.listdir(filePath)
fileList = []
@Sebastian1011
Sebastian1011 / pyserver.sh
Last active December 1, 2023 05:47
Bash start python simple server
#!/bin/bash
if [ -z "$1" ]; then
# server port can not be empty
echo "server stoped, please input serve port"
exit
fi
echo "Python SimpleHTTPServer Start at port: $1"
@Sebastian1011
Sebastian1011 / ssh_on_windows.md
Last active December 1, 2023 05:48
ssh client on windows
  1. bitise ssh client or server
  2. putty client
@Sebastian1011
Sebastian1011 / .Xmodmap
Last active November 2, 2016 16:03
tools
remove Lock = Caps_Lock
remove Control = Control_L
remove mod1 = Alt_L
remove Shift = Shift_L
keysym Caps_Lock = Shift_L
keysym Control_L = Alt_L
keysym Shift_L = Control_L
keysym Alt_L = Caps_Lock
@Sebastian1011
Sebastian1011 / pythonSendEmail.py
Last active November 11, 2016 13:54
python send email
#!/usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.MIMEImage import MIMEImage
import sys
import os
import re
@Sebastian1011
Sebastian1011 / screenShot.py
Created November 11, 2016 13:55
python screenshot
#!/usr/bin/python
import sys
import time
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class Screenshot(QWebView):
def __init__(self):
self.app = QApplication(sys.argv)
ffmpeg功能极其强大,堪比图像处理的ImageMagik。下面是一些常用的命令,记下备用。
1:得到视频信息
ffmpeg -i input.xxx
2: 将图像序列转换为视频
ffmpeg -f image2 -i prefix%d.jpg output.xxx
3:将视频转换为图像序列
ffmpeg -i input.xxx -r FPS -qscale 1 -vsync 0 $prefix%d.jpg
其中FPS为每秒抽多少帧
4:将视频转换为yuv格式
ffmpeg -i input.avi ouput.yuv
@Sebastian1011
Sebastian1011 / cssCommon.sass
Last active November 18, 2016 06:19
css 形状
.circle {
border-radius: 50%;
width: 200px;
height: 200px;
/* width and height can be anything, as long as they're equal */
box-shadow: 0 0 0 10px rgba(255, 78, 82, 0.50);
}
/*border line-gradient*/
.border-grad{
To download and install Atom in Ubuntu 14.04 ( the version i am using ) you have to type following command one by one in your terminal.
Step 1 : Add repository:
sudo add-apt-repository ppa:webupd8team/atom
Press Enter if it ask your permission.
Step 2 : Update the Repository
sudo apt-get update
数据通信
1、上下级之间通过回掉函数进行通信
2、同级之间通过上级进行通信和更新数据
3、以全局事件的形式进行通信
4、flux redux等数据导流的方式
Redux
主要分为3个部分:Action, Reducer , Store
主要功能