Skip to content

Instantly share code, notes, and snippets.

View caorong's full-sized avatar
🎯
Focusing

caorong caorong

🎯
Focusing
View GitHub Profile
@caorong
caorong / gem_make.out
Created February 20, 2014 14:23
the output when install nokogiri 1.6.1
$ gem install nokogiri -V -v 1.6.1 -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib --with-iconv-dir=/usr/local/Cellar/libiconv/1.14 --with-iconv-include=/usr/local/Cellar/libiconv/1.14/include --with-iconv-lib=/usr/local/Cellar/libiconv/1.14/lib
HEAD http://ruby.taobao.org/specs.4.8.gz
200 OK
GET http://ruby.taobao.org/specs.4.8.gz
200 OK
/usr/local/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.1/.autotest
/usr/local/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.1/.gemtest
/usr/local/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.1/.travis.yml
/usr/local/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.1/CHANGELOG.ja.rdoc
/usr/local/lib/ruby/gems/2.1.0/gems/nokogiri-1.6.1/CHANGELOG.rdoc
@caorong
caorong / mian2.js
Created July 7, 2014 14:24
sm's interview question
function numberToCN(number){
number = parseInt(number,0);
if(isNaN(number)){
return false;
}
if(number === 0){
return '零';
}
@caorong
caorong / .ycm_extra_conf.py
Created July 10, 2014 15:10
ycm conf for apue2
import os
import ycm_core
from clang_helpers import PrepareClangFlags
# Set this to the absolute path to the folder (NOT the file!) containing the
# compile_commands.json file to use that instead of 'flags'. See here for
# more details: http://clang.llvm.org/docs/JSONCompilationDatabase.html
# Most projects will NOT need to set this to anything; you can just change the
# 'flags' list of compilation flags. Notice that YCM itself uses that approach.
compilation_database_folder = ''
from struct import *
ofile=open('sz000680.day','rb')
buf=ofile.read()
ofile.close()
ifile=open('sz000680.txt','w')
num=len(buf)
no=num/32
b=0
e=32
@caorong
caorong / emoji_filter.java
Created August 14, 2014 10:40
过滤 emoji
public String getFormatTitle(String str) {
Pattern emoji = Pattern.compile("[\ud83c\udc00-\ud83c\udfff]|[\ud83d\udc00-\ud83d\udfff]|[\u2600-\u27ff]",
Pattern.UNICODE_CASE | Pattern.CASE_INSENSITIVE);
Matcher emojiMatcher = emoji.matcher(str);
return emojiMatcher.replaceAll("");
}
@caorong
caorong / douyu_yuwan.py
Last active August 29, 2015 14:05
刷douyu 鱼丸
# coding: utf-8
import requests, time,datetime, re, sets, sys, os
proxies = {
# "http": "http://115.29.166.133:82",
# "http": "http://119.31.123.207:8000",
# "http": "http://120.198.230.16:80",
# "http": "http://120.198.230.17:80",
# "http": "http://220.181.32.106:80",
@caorong
caorong / http.c
Created September 10, 2014 07:08
fix ffmpeg http request with custom header meet "No trailing CRLF found in HTTP header"
if (s->headers) {
int len = strlen(s->headers);
printf("len = %d\n", len);
printf("syso headers -> %s\n", s->headers);
char* tmpheader = malloc(len+2);
strcpy(tmpheader, s->headers);
tmpheader[len]='\r';
tmpheader[len+1]='\n';
tmpheader[len+2]='\0';
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@caorong
caorong / reflect.py
Last active August 29, 2015 14:10 — forked from huyng/reflect.py
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@caorong
caorong / vps config
Last active August 29, 2015 14:13
vps config
apt-get install git vim gcc make libc6-dev build-essential
# change timezone
sudo dpkg-reconfigure tzdata
wget https://bootstrap.pypa.io/get-pip.py
# remove ssh passwordlogin
vim /etc/ssh/sshd_config
PasswordAuthentication no