import requests
from bs4 import BeautifulSoup
from lxml import etree
import re
import html
import pprint
pp = pprint.PrettyPrinter(indent=4)
TAG_RE = re.compile(r'<[^>]+>')
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
wget -P /usr/local/lib https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/librocketmq.dylib | |
wget -P /usr/local/lib https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/librocketmq_client_core.dylib | |
wget -P /usr/local/include https://ons-client-sdk.oss-cn-hangzhou.aliyuncs.com/cpp-rpm/darwin/rocketmq.tar.gz | |
tar -xzf /usr/local/include/rocketmq.tar.gz -C /usr/local/include/ | |
install_name_tool -id "@rpath/librocketmq_client_core.dylib" /usr/local/lib/librocketmq_client_core.dylib |
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
# FROM alpine:latest as builder | |
# RUN apk add -u crystal shards libc-dev | |
# WORKDIR /src | |
# COPY . . | |
# RUN crystal build --release src/api_demo.cr -o /src/api_demo |
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
FROM elixir:1.9.1-alpine as build | |
# # install build dependencies | |
RUN apk add --no-cache \ | |
gcc \ | |
g++ \ | |
git \ | |
make \ | |
musl-dev | |
RUN mix do local.hex --force, local.rebar --force |
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
class MongoCache: | |
db = None | |
def __init__(self): | |
if not hasattr(MongoCache, 'pool'): | |
MongoCache.create_instance() | |
@staticmethod | |
def create_instance(): |
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
#! /bin/sh | |
host_dir=`echo ~` # 当前用户根目录 | |
proc_name="net_speeder" # 进程名 | |
file_name="/root/log/netspeed.log" # 日志文件 | |
pid=0 | |
proc_num() # 计算进程数 | |
{ | |
num=`ps -ef | grep $proc_name | grep -v grep | wc -l` |
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
#!/bin/bash | |
STASH_NAME="pre-commit-$(date +%s)" | |
git stash save -q --keep-index $STASH_NAME | |
cd backend | |
ERROR_MSG=`rails test | grep "errors,"` | |
cd - | |
TASHES=$(git stash list) |
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
{ | |
"indent_size": 2, | |
"indent_char": " ", | |
"eol": "\n", | |
"indent_level": 0, | |
"indent_with_tabs": false, | |
"preserve_newlines": true, | |
"max_preserve_newlines": 2, | |
"jslint_happy": false, | |
"space_after_anon_function": false, |
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.path, re | |
filename = os.path.expanduser("~/.ssh/config") | |
hosts = [] | |
file = open(filename, 'rb') | |
contents = file.read() | |
for line in contents.split('\n\n'): | |
m = re.search('[Hh]ost\s+(?P<host_name>\w+)', line) | |
if m is not None: |
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
{ | |
"libs": [ | |
], | |
"plugins" : { | |
"node" : { | |
} | |
}, | |
"ecmaVersion": 6 | |
} |