Skip to content

Instantly share code, notes, and snippets.

@benwu232
benwu232 / bdf2bmp
Last active August 29, 2015 14:01
bdf2bmp
bdf2bmp -s2 -c16 abc.bdf abc.bmp
@benwu232
benwu232 / gist:c9e94841f91386bf6602
Last active August 29, 2015 14:01
add 0x and , to n-digit hex numbers in vim
%s#\([0-9,A-F,a-f].\)#0x\1,#g
git push https://abc@bitbucket.org/abc/abc.git master --force
@benwu232
benwu232 / gist:0a3a07328376a18cf4b7
Created May 20, 2014 11:51
rename and modify tags of audios of harry potter to play in Android phone in order
# This script renames Harry Potter audio file names to play on Android in order
import os
import re
import eyed3
def sub_func1(m):
strm = m.group()
digit_len = len(strm)-1
prefix = ''
@benwu232
benwu232 / gist:54d39d52ac04cd4b04d3
Created August 6, 2014 15:39
force git to overwrite local files on pull
git fetch --all
git reset --hard origin/master
@benwu232
benwu232 / lan-wifi.bat
Created August 22, 2014 08:07
Switch between WiFi and LAN in windows.
@Echo off
Echo Switch between LAN and WiFi
net start dot3svc
netsh wlan show interfaces >NUL
choice /C 12 /M "1: WiFi; 2: LAN"
@benwu232
benwu232 / gist:41cff41bd9dc0449bd89
Created October 6, 2014 02:25
know the running python is 32-bit or 64-bit
import struct
print(struct.calcsize("P") * 8)
@benwu232
benwu232 / .theanorc
Created February 5, 2016 07:30
theano setting
[cuda]
root = /usr/local/cuda
[global]
device = gpu
floatX = float32
[nvcc]
fastmath = True
from __future__ import print_function
import numpy as np
np.random.seed(1337) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D, ZeroPadding2D
from keras.utils import np_utils
@benwu232
benwu232 / gist:c71d65a392289e4570be8e1bda2f1cde
Created September 19, 2016 14:28
install meld to ubuntu, just run nautilus
apt-get install meld nautilus-compare