Skip to content

Instantly share code, notes, and snippets.

View yinheli's full-sized avatar
👋
我在寻找新的工作机会,欢迎和我联系

yinheli yinheli

👋
我在寻找新的工作机会,欢迎和我联系
View GitHub Profile
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
@yinheli
yinheli / SampleSM.java
Created July 31, 2014 07:27
银联mac算法, 示例
// 示例代码
class SampleSM {
...
public byte[] generateUnpayMACImpl(byte[] data, SecureDESKey kd)
throws SMException {
data = ISOUtil.concat(data, new byte[8]);
int len = data.length - data.length % 8;
if (data.length != len) {
@yinheli
yinheli / simditor-replay.coffee
Last active August 29, 2015 14:05
http://ziranzhi.com/ 写的 Simditor 插件, 解决回复 @ 的问题
class ReplayPlugin extends Plugin
constructor: (@widget) ->
super @widget
@editor = @widget
$('.bbp-admin-links a').on 'click', (e) =>
node = $(e.currentTarget).parent().parent().find('.bbp-author-name').clone()
node.text '@'+node.text()
@editor.trigger 'focus'
@editor.selection.insertNode node.append('  ')
package socks5
import (
"net"
"time"
"bytes"
"errors"
"bufio"
"strconv"
"strings"
if (/(10\.\d{1,3}\.\d{1,3}\.\d{1,3})|(172\.(1[6789]|2[0-9]|3[01])\.\d{1,3}\.\d{1,3})|(192\.168\.\d{1,3}\.\d{1,3})/.test(ipAddr)) {
// Successful match
} else {
// Match attempt failed
}
@yinheli
yinheli / v.js
Created August 29, 2014 04:12
自动访问一遍页面的全部链接, 如果这个页面用了 jQuery
var idx = 0;
var hrefPool = new Array();
hrefPool.push('/signup');
hrefPool.push('/signin');
hrefPool.push('/signout');
$('a').each(function(){
var href = $(this).attr('href');
if (href.indexOf('http') != -1) {
return
@yinheli
yinheli / isayme.xcs
Created September 1, 2014 15:24 — forked from isayme/isayme.xcs
[isayme]
text(bold)=eaeaea
magenta(bold)=ff00ff
text=ffffff
white(bold)=eaeaea
green=00c000
red(bold)=d20000
green(bold)=00ff00
black(bold)=808080
red=c00000
@yinheli
yinheli / app.js
Last active August 29, 2015 14:10 — forked from fidelisrafael/app.js
// clone this gist to a empty folder, the run:
// npm init (and follow steps)
// npm install express --save
// npm install swig --save
// node app.js and open http://localhost:3000
function App() {
var express = require('express');
@yinheli
yinheli / master.vim
Last active August 29, 2015 14:13 — forked from gmccreight/master.vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon