This file contains 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 | |
# -*- coding: utf-8 -*- | |
# @Author: Comzyh | |
# @Date: 2016-01-29 01:12:22 | |
# @Last Modified by: Comzyh | |
# @Last Modified time: 2016-01-29 02:29:15 | |
import requests | |
import json | |
import time |
This file contains 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
# -*- coding: utf-8 -*- | |
# @Author: Comzyh | |
# @Date: 2016-05-07 22:46:41 | |
# @Last Modified by: Comzyh | |
# @Last Modified time: 2016-05-08 03:12:27 | |
import aioamqp | |
import asyncio | |
import logging | |
import sys | |
import datetime |
This file contains 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
sudo yum install libxslt-devel gd gd2 gd-devel gd2-devel perl-devel perl-ExtUtils-Embed geoip-devel | |
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_mod |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
# Thanks @xianhu | |
# referer: https://github.com/xianhu/LearnPython/blob/master/python_weibo.py | |
import requests | |
import urllib | |
import base64 | |
import time | |
import json | |
import logging |
This file contains 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
.file "a.cpp" | |
.text | |
.section .rodata.str1.1,"aMS",@progbits,1 | |
.LC10: | |
.string "a.cpp" | |
.section .rodata.str1.8,"aMS",@progbits,1 | |
.align 8 | |
.LC11: | |
.string "bits1(arr[i]) == bits2(arr[i])" | |
.section .rodata.str1.1 |
This file contains 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
import os | |
import os.path | |
import sys | |
import codecs | |
def main(): | |
print(sys.argv[1]) | |
for root, dirs, files in os.walk(sys.argv[1]): | |
for file in files: | |
if file.endswith('.h'): |
This file contains 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
{ | |
"name": "Ubuntu", | |
"comment": "Ubuntu default/theme terminal colors for tilix", | |
"use-theme-colors": false, | |
"foreground-color": "#ffffff", | |
"background-color": "#300a24", | |
"palette": [ | |
"#2e3436", | |
"#cc0000", | |
"#4e9a06", |
This file contains 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
import re | |
import sys | |
def main(): | |
for line in sys.stdin.readlines(): | |
line = re.sub(r'\\textbf\{(?P<value>(\d+)?\.\d+)\}', lambda g: g.group('value'), line) | |
maxval = 0.0 | |
for v in re.finditer(r'(?P<value>(\d+)?\.\d+)', line): | |
maxval = max(maxval, float(v.group('value'))) | |
def rep_func(group): | |
# print(float(group.group('value')) == maxval) |
This file contains 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 <algorithm> | |
#include <random> | |
#include <iostream> | |
using namespace std; | |
template< class RandomIt> | |
void partial_random_shuffle( RandomIt first, RandomIt last, RandomIt part) { | |
typename std::iterator_traits<RandomIt>::difference_type i, n, p; | |
p = part - first; | |
n = last - first; |
This file contains 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 <algorithm> | |
#include <random> | |
#include <iostream> | |
#include <vector> | |
using namespace std; | |
vector<int> random_k_in_n(size_t k, int n) { // generate k distinct number in [0..n-1] | |
vector<int> ans; | |
ans.reserve(k); | |
std::random_device rd; |
OlderNewer