Skip to content

Instantly share code, notes, and snippets.

@bianle
bianle / 0-cpu.py
Last active November 19, 2015 14:57
python 树莓派 cpu ip
#!/usr/bin/env python
#
# $Id: iotop.py 1160 2011-10-14 18:50:36Z g.rodola@gmail.com $
#
# Copyright (c) 2009, Jay Loden, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Transplant to NT system by hui.wang, 2012-11-28
# Add function of get cpu state and get memory state by hui.wang,2012-11-29
@bianle
bianle / 0-chengfakoujue.py
Last active November 19, 2015 14:59
python 趣味
print '\n'.join([' '.join(['%s*%s=%-2s' % (y,x,x*y) for y in range(1,x+1)]) for x in range(1,10)])
@bianle
bianle / DESenc.java
Last active November 17, 2015 02:11
加密解密
import java.security.*;
import javax.crypto.*;
public class DESEnc {
private static String strDefaultKey = "86b21af7cdef3dc6";
private Cipher encryptCipher = null;
private Cipher decryptCipher = null;
public static String byteArr2HexStr(byte[] arrB) throws Exception {
int iLen = arrB.length;
@bianle
bianle / IE直接显示Json.reg.bat
Last active December 24, 2015 13:54
windows命令
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/json]
"CLSID"="{25336920-03F9-11cf-8FD0-00AA00686F13}"
"Encoding"=dword:00080000
[HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/json]
@bianle
bianle / git.sh
Last active December 3, 2015 02:50
git 命令(windows)
#设置记住密码(默认15分钟):
git config --global credential.helper cache
#如果想自己设置时间,可以这样做:(这样就设置一个小时之后失效)
git config credential.helper 'cache --timeout=3600'
#长期存储密码:
git config --global credential.helper store
#增加远程地址的时候带上密码
@bianle
bianle / emacs.md
Last active November 14, 2015 07:48
emacs
  • emace重新加载文件

    M-x load-file ENTER
    ~/.emacs
    ENTER

@bianle
bianle / jquery-trigger.js
Created November 14, 2015 07:43
jquery模拟用户点击
$('#btn').trigger("click");
$('#btn').click();
//自定义事件
$('#btn').bind("myClick", function(){
$('#test').append("<p>我的自定义事件.</p>");
});
$('#btn').trigger("myClick");
@bianle
bianle / 0_reuse_code.js
Created November 13, 2015 08:41
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console