Skip to content

Instantly share code, notes, and snippets.

View wynnzen's full-sized avatar
🍊
Focusing

wynnzen wynnzen

🍊
Focusing
View GitHub Profile
@wynnzen
wynnzen / tokyo-night.itermcolors
Created July 5, 2021 01:26
iterm2 theme-tokyo night
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.40784314274787903</real>
@wynnzen
wynnzen / weixin_robot.py
Last active March 31, 2017 03:51
weixin_robot
#coding=utf-8
from wxpy import *
bot = Bot(console_qr=False,cache_path=True)
myfriend2 = bot.mps().search("小冰")[0]
mygroup = bot.groups().search("某个组名")[0]
@bot.register([mygroup], TEXT)
def reply_my_friend(msg):
myfriend2.send(msg.text)
@bot.register([myfriend2], TEXT)
@wynnzen
wynnzen / zero_str.js
Created December 12, 2016 11:39
add zero before str
function addZero(str,length){
return new Array(length - str.length + 1).join("0") + str;
}
@wynnzen
wynnzen / textarea-linebreak.jsx
Created August 26, 2016 04:07
react textarea javascript line break
{this.props.section.text.split(“\n”).map(function(item) {
return (
<span>
{item}
<br/>
</span>
)
})
@wynnzen
wynnzen / antdesign-table.jsx
Last active August 26, 2016 04:00
ant design react javascript table
class CompanyManager extends React.Component {
constructor(props) {
super(props);
this.state = {
}
}
render () {
@wynnzen
wynnzen / repl_shortcut
Last active September 20, 2023 09:20
sublime repl shortcut setting
[
{"keys":["f5"],
"caption": "SublimeREPL: Python - RUN current file",
"command": "run_existing_window_command",
"args":
{
"id": "repl_python_run",
"file": "config/Python/Main.sublime-menu"
}},
{"keys":["f4"],
@wynnzen
wynnzen / wait_sec_and_back.html
Last active August 29, 2015 14:05
back to the page
<!DOCTYPE html>
<html>
<head>
<title>浏览器对象</title>
<meta http-equiv="Content-Type" content="text/html; charset=gkb"/>
</head>
<body>
<!--先编写好网页布局-->
<h3>操作成功</h3>
<span id="sec">5</span>秒后回到主页
@wynnzen
wynnzen / killadb.py
Last active August 29, 2015 14:05
killadb
import os
import re
com = "5037"
adblist=list()
info = os.popen("netstat -ano|findstr " + com).readlines()
for i in info:
m = re.match(r"\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)", i)
adblist.append(m.group(4))
print adblist
for j in adblist:
@wynnzen
wynnzen / gist:b874e2c0c5b6f6b924ab
Last active August 29, 2015 14:02
遍历文件夹中的文件
import os
import os.path
rootdir = "d:\data" # 指明被遍历的文件夹
for parent,dirnames,filenames in os.walk(rootdir): #三个参数:分别返回1.父目录 2.所有文件夹名字(不含路径) 3.所有文件名字
for dirname in dirnames: #输出文件夹信息
print "parent is:" + parent
print "dirname is" + dirname
for filename in filenames: #输出文件信息
import random
def randomssid(self, length=255):
randomvalue = list()
for i in range(length):
val_cjk = random.randint(0x4E00, 0x9FBF) # CJK
val_ascii = random.randint(0x0020, 0x007e) # ascii
val_fascii = random.randint(0xff01, 0xff64) # fullwidth ascii
randomvalue.append(
unichr(random.choice([val_cjk, val_ascii, val_fascii])))
return randomvalue