###hello
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python3 | |
# 3rd party libs | |
setuptools==42.0.0 | |
Flask==1.0.2 | |
Flask-RESTful==0.3.6 | |
Flask-SQLAlchemy==2.3.2 | |
flask-script==2.0.6 | |
flask_migrate==2.1.1 | |
MySQL-python==1.2.5 | |
#PyMySQL==0.9.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
def _hook_requests(): | |
try: | |
from requests.sessions import Session | |
except ImportError: | |
return | |
real_send = Session.send |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
last_sunday=`date -v-sunday +"%Y-%m-%d"` | |
author=`git config --get user.name` | |
cmd="git shortlog --author=$author --after=$last_sunday --oneline" | |
echo $cmd | |
for i in `ls .`;do | |
if [ -d ~/Codes/$i ];then | |
cd ~/Codes/$i | |
if [ ! -d ".git" ];then | |
continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Uses ESLint as a soft guard of code quality for your repo | |
# allows commits to go through if re-attempted within a pre-set interval | |
# copy to .git/hooks/commit-msg to have things work | |
# Based on: https://gist.github.com/wesbos/8aec9d2ff7f7cf9dd65ca2c20d5dfc23 | |
PRESET_TIME_INTERVAL=20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# toggle showing all file on mac os x | |
toggle_hidden_dotfiles() { | |
local is_dotfiles_hidden=$(defaults read com.apple.finder AppleShowAllFiles) | |
if [[ $is_dotfiles_hidden == "No" ]]; then | |
defaults write com.apple.finder AppleShowAllFiles Yes && killall Finder | |
else | |
defaults write com.apple.finder AppleShowAllFiles No && killall Finder | |
fi | |
} | |
alias thide=toggle_hidden_dotfiles |
###hello
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on WriteToFile(this_data, target_file) -- (string, file path as string) | |
do shell script "echo " & quoted form of this_data & ">> " & quoted form of target_file | |
end WriteToFile | |
on WordQuery(theString) | |
tell application "YoudaoDict" to activate | |
tell application "System Events" | |
tell process "YoudaoDict" | |
try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def format_dict(array): | |
return {array[0]: {array[1]: array[2], | |
array[3]: array[4]}} | |
def proc(array): | |
if (len(array) % 5): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//是Linux 系统的日期时间头文件。通常会包含include time.h | |
#include <sys/time.h> | |
// 是ISO C99 标准日期时间头文件。编写的代码平台无关的需要引入 | |
#include <time.h> | |
//让函式能够接收不定量参数,va_list需要 | |
#include <stdarg.h> | |
#define DEBUG 1 |
NewerOlder