This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Converts any integer into a base [BASE] number. I have chosen 62 | |
# as it is meant to represent the integers using all the alphanumeric | |
# characters, [no special characters] = {0..9}, {A..Z}, {a..z} | |
# | |
# I plan on using this to shorten the representation of possibly long ids, | |
# a la url shortenters | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# default.custom.yaml | |
# save it to: | |
# ~/.config/ibus/rime (linux) | |
# ~/Library/Rime (macos) | |
# %APPDATA%\Rime (windows) | |
patch: | |
schema_list: | |
- schema: luna_pinyin # 朙月拼音 | |
- schema: terra_pinyin # 地球拼音 dì qiú pīn yīn |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/antirez/redis/blob/unstable/redis.conf | |
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#define SIZE 10 | |
void ShuffleArray_Fisher_Yates(char* arr, const int len) | |
{ | |
int i = len, j; | |
char temp; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct Node { | |
int data; | |
struct Node *next; | |
} Node; | |
Node *create_node(int n) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
import os | |
import subprocess | |
import sys | |
def smaller_images(): | |
if len(sys.argv) != 3: | |
print "Usage: python image_smaller.py <Path> 0.X" | |
return | |
path = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding=utf8 | |
""" | |
有豹子,老虎,狮子,都一大一小,三个大的和小老虎都会划船,其他两个 | |
不会划,每次只能过两个,大吃小(没有大的在保护就被吃掉). | |
这2个动物怎样才能过河? | |
""" | |
from itertools import combinations | |
def is_bad(L): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yum remove -y pptpd ppp | |
iptables --flush POSTROUTING --table nat | |
iptables --flush FORWARD | |
rm -rf /etc/pptpd.conf | |
rm -rf /etc/ppp | |
wget http://poptop.sourceforge.net/yum/stable/packages/dkms-2.0.17.5-1.noarch.rpm | |
wget http://poptop.sourceforge.net/yum/stable/packages/kernel_ppp_mppe-1.0.2-3dkms.noarch.rpm | |
wget ftp://ftp.muug.mb.ca/mirror/centos/6.3/os/x86_64/Packages/ppp-2.4.5-5.el6.x86_64.rpm | |
wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-2.el6.x86_64.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib2 import urlopen | |
from subprocess import Popen, PIPE | |
from bs4 import BeautifulSoup | |
page = urlopen('http://pyvideo.org/category/33/pycon-us-2013') | |
soup = BeautifulSoup(page) | |
video_url_list = [] | |
count = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p tmp_dir_to_install_grep | |
cd tmp_dir_to_install_grep | |
wget https://ftp.gnu.org/gnu/grep/grep-2.18.tar.xz | |
tar xf grep-2.18.tar.xz | |
cd grep-2.18/ | |
./configure && make && sudo make install |
OlderNewer