Skip to content

Instantly share code, notes, and snippets.

View Nicksxs's full-sized avatar
🤔
boring

Nicksxs Nicksxs

🤔
boring
View GitHub Profile
@dervn
dervn / re.py
Created March 8, 2011 02:08
Python中过滤HTML标签的函数
#用正则简单过滤html的<>标签
import re
str = "<img /><a>srcd</a>hello</br><br/>"
str = re.sub(r'</?\w+[^>]*>','',str)
print str
@baopham
baopham / Monaco for Powerline.otf
Last active April 16, 2023 03:57
Patched font Monaco for OSX Vim-Powerline
@quexer
quexer / jQuery-plugin-authoring.md
Created September 4, 2012 09:42
如何编写 jQuery 插件

创建插件


看来 jQuery 你已经用得很爽了,想学习如何自己编写插件。非常好,这篇文档正适合你。用插件和方法来扩展 jQuery 非常强大,把最聪明的功能封装到插件中可以为你及团队节省大量开发时间。

开始

@dustismo
dustismo / gist:6203329
Last active July 22, 2024 18:51
How to install leveldb on ubuntu
sudo apt-get install libsnappy-dev
wget https://leveldb.googlecode.com/files/leveldb-1.9.0.tar.gz
tar -xzf leveldb-1.9.0.tar.gz
cd leveldb-1.9.0
make
sudo mv libleveldb.* /usr/local/lib
cd include
sudo cp -R leveldb /usr/local/include
@guweigang
guweigang / git_toturial
Last active July 23, 2024 08:39
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@gerardorochin
gerardorochin / php_error_logstash.conf
Created June 2, 2014 15:39
php error logging into logstash + elasticsearch and trace errors on single line and root path hidden
input {
file {
type => "php-error"
path => "/var/www/error_log"
sincedb_path => "/opt/logstash/sincedb-access"
}
}
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@v5tech
v5tech / jenv.md
Created September 15, 2014 03:43
Mac下同时安装多个版本的JDK

Mac下同时安装多个版本的JDK

Mac自带了的JDK6,安装在目录:/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/下。

JDK7,JDK8则需要自己到Oracle官网下载安装对应的版本。自己安装的JDK默认路径为:/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk

1. 在用户目录下的bash配置文件.bashrc中配置JAVA_HOME的路径:

export JAVA_6_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
@jcupitt
jcupitt / watermark.py
Last active September 7, 2021 14:34
watermarking with vips8 python
#!/usr/bin/python3
import sys
import pyvips
im = pyvips.Image.new_from_file(sys.argv[1], access="sequential")
text = pyvips.Image.text(sys.argv[3], width=500, dpi=300, align="centre")
text = (text * 0.3).cast("uchar")
text = text.rotate(45)
@jcupitt
jcupitt / watermark.c
Last active February 29, 2020 12:06
watermark an image with the vips8 C API
/* watermark an image with libvips C. It handles monon, RGB and CMYK images.
*
* compile with
gcc -g -Wall watermark.c `pkg-config vips --cflags --libs`
*/
#include <vips/vips.h>