Skip to content

Instantly share code, notes, and snippets.

View binderclip's full-sized avatar
👨‍💻
build

clip binderclip

👨‍💻
build
  • Beijing
View GitHub Profile
@binderclip
binderclip / change-theme-for-quiver.md
Created April 4, 2016 08:18
给 Quiver 换主题
@binderclip
binderclip / bluetooth-messy-notes.md
Created April 4, 2016 08:29
蓝牙原理的了解(杂乱的笔记)

是有看一本专门介绍蓝牙的书,看过之后对蓝牙基本的东西有了一些了解,就能轻松的知道它能干什么不能干什么,适合干什么,不适合干什么。

  • client
  • server

initiates a connection

outgoing choose a target device transport protocol

@binderclip
binderclip / set-mac-proxy-by-shell.md
Created April 12, 2016 06:11
Set Mac Proxy By Shell

设置 DNS 的脚本:

#!/bin/bash
# This script sets the Wi-Fi DNS to Aliyun DNS
sudo networksetup -setdnsservers Wi-Fi 223.5.5.5 223.6.6.6

设置为空:

@binderclip
binderclip / check_if_file_utf_8.py
Created May 11, 2016 14:52
simple python script check if file utf-8 coding
import sys
def main():
if len(sys.argv) < 2:
print 'please enter file path'
file_path = sys.argv[1]
with open(file_path, 'r') as f:
s = f.read()
try:
@binderclip
binderclip / flask_file_upload.py
Created July 18, 2016 08:57
Flask file upload
import os
from flask import Flask, request, redirect, url_for, send_from_directory
from werkzeug.utils import secure_filename
UPLOAD_FOLDER = '/tmp/flask-upload-test/'
ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER
# coding:utf-8
import csv
def add_bom():
filename = 'pool1xcf电器池1_.csv'
with open('{filename}'.format(filename=filename), 'r+b') as file:
file.write('\xef\xbb\xbf')
@binderclip
binderclip / emoji.plist
Created December 14, 2016 14:05 — forked from xhacker/emoji.plist
/System/Library/LinguisticData/RequiredAssets_zh.bundle/AssetData/emoji.plist in OS X 10.11 Copyright (C) Apple Inc.
<?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>0</key>
<dict>
<key>emoji</key>
<array>
<string>0⃣️</string>
</array>
@binderclip
binderclip / config_per_commit_exclude.md
Created March 15, 2017 09:39
如何设置 pre_commit 的 exclude

如何设置 pre_commit 的 exclude

首先 exclude 只能作用于 hook,所以需要在 hook 的位置去配置,而不能作用于全局的 repo,可以从下面看到:

https://github.com/pre-commit/pre-commit/blob/master/pre_commit/clientlib.py#L51

另外实验一下会发现在 repo 上配置 exclude 不会被读取(比如故意填写成 array 也不会报错)。而在 hook 上类型填错的话会报错。

另外在 run_hook 的函数中也看到了是从 hook 的配置中读取的配置。

@binderclip
binderclip / gist:b3f48514d759c710d2f3bc07fdbd0cb2
Created August 28, 2017 12:19 — forked from aqualungdesign/gist:4612802
Changing the photoshop cs6 language. MAC OS
#go to folder:
/Applications/Adobe Photoshop CS6/Locales/pt_BR/Support Files/tw10428.dat
#rename the file tw10428.dat for tw10428.bak