Skip to content

Instantly share code, notes, and snippets.

View iohub's full-sized avatar
💭
I may be slow to respond.

iohub

💭
I may be slow to respond.
View GitHub Profile
@iohub
iohub / pystock.py
Last active February 24, 2020 01:28
# -*- coding: utf8 -*-
import requests
import json
import sys
import os
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
def get_klines(code):
@iohub
iohub / imgdownlader-v2.py
Last active February 24, 2020 01:28
imgdownlader-v2.py
import requests
import os
import re
def save(url):
buf = url.strip().split('/')
dirname = buf[-2]
fname = buf[-1]
@iohub
iohub / ycm_extra_conf.py
Last active November 28, 2018 12:21
ycm_extra_conf.py
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
#
# Here's the license text for this file:
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
@iohub
iohub / gogo
Created November 9, 2018 06:41
#!/bin/bash
cdir=`pwd`
pkg=$1
if [ ! -z "$pkg" -a "$pkg" != " " ]; then
gofiles=`find ${pkg} -name '*.go' -print | grep -v -i test | grep -v remote`
else
gofiles=`find . -path ./vendor -prune -o -name '*.go' -print | grep -v -i test | grep -v remote`
fi
@iohub
iohub / fund_scanner.py
Last active January 4, 2019 03:49
fund_scanner.py
# -*- coding:utf-8 -*-
import json
import requests
headers = {
'Connection': 'keep-alive',
'Referer': 'https://danjuanapp.com/funding/003853?channel=1300100141',
'Accept': 'application/json, text/plain, */*',
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36',
@iohub
iohub / vimrc
Last active February 24, 2020 09:44 — forked from lambdae/vimrc
vim profile
set encoding=utf-8
set fileencodings=utf-8,gb2312,gb18030,gbk,ucs-bom,cp936,latin1
filetype plugin indent on
syntax on
set foldmethod=indent
let mapleader=";"
"-------
" YouCompleteMe
@iohub
iohub / YouCompleteMe-inst.sh
Last active October 27, 2018 11:29 — forked from lambdae/YouCompleteMe-inst.sh
auto compile glibc & clang & YouCompleteMe
#!/bin/bash
BUILD_DIR=`pwd`/build
CUSTOM_DIR=/tmp/opt/
CMAKE_DIR=$CUSTOM_DIR/cmake
CLANG_DIR=$CUSTOM_DIR/clang
YCM_DIR=$CUSTOM_DIR/dconf/bundle/vundle/YouCompleteMe
LIBCLANG=$CLANG_DIR/lib/libclang.so
@iohub
iohub / prebuilt-denv.sh
Last active November 9, 2018 16:01
prebuilt-denv.sh
#!/bin/bash
BASE=/tmp/opt/base
# export CXXFLAGS="-Wl,--rpath=/tmp/opt/glibc/lib:/tmp/opt/gcc6.4.0/lib64:/lib64:/usr/lib64:/lib -Wl,--dynamic-linker=/tmp/opt/glibc/lib/ld-2.18.so"
# ../gcc-6.4.0/configure --prefix=/tmp/opt/gcc6.4.0 --enable-languages=c,c++ --disable-multilib --enable-shared --disable-bootstrap --disable-libstdcxx-pch
GHOME=/tmp/opt/gcc6.4.0
PYHOME=/tmp/opt/py2.7
VIMHOME=/tmp/opt/vim
# ../glibc-2.18/configure --prefix=/tmp/opt/glibc
GLIBC=/tmp/opt/glibc
@iohub
iohub / genv.sh
Last active October 23, 2018 15:19
genv
#!/bin/bash
BASE=/tmp/opt/base
# export CXXFLAGS="-Wl,--rpath=/tmp/opt/glibc/lib:/tmp/opt/gcc6.4.0/lib64:/lib64:/usr/lib64:/lib -Wl,--dynamic-linker=/tmp/opt/glibc/lib/ld-2.18.so"
# ../gcc-6.4.0/configure --prefix=/tmp/opt/gcc6.4.0 --enable-languages=c,c++ --disable-multilib --enable-shared --disable-bootstrap --disable-libstdcxx-pch
GHOME=/tmp/opt/gcc6.4.0
PYHOME=/tmp/opt/py2.7
VIMHOME=/tmp/opt/vim
# ../glibc-2.18/configure --prefix=/tmp/opt/glibc
GLIBC=/tmp/opt/glibc
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"