class Functor f where
fmap :: (a -> b) -> f a -> f b
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 platform | |
import re | |
import time | |
import cffi | |
from eth_account.messages import encode_defunct | |
from web3 import Web3 | |
import simplejson as json | |
import asyncio | |
current_os = platform.system() |
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 requests | |
from lxml import html | |
from PIL import Image | |
import io | |
from itertools import starmap | |
def grab_list(url): | |
title_path = '//td[@class="huanhang"]/a/text()' | |
link_path = '//td[@class="huanhang"]/a/@href' | |
raw_data = html.fromstring(requests.get(url).text) |
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
# ref: https://medium.com/better-programming/writing-ios-apps-without-xcode-89450d0de21a | |
# MetaData | |
CLANG = /usr/bin/clang | |
CLANG_OBF = /usr/local/opt/llvm/bin/clang | |
PROJECT_NAME = Test | |
SOURCE_DIR = Test | |
BUNDLE_DIR = ${PROJECT_NAME}.app | |
TEMP_DIR = _BuildTemp |
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 docker.elastic.co/apm/apm-server:7.7.0 | |
COPY apm-server.yml /usr/share/apm-server/apm-server.yml | |
USER root | |
RUN chown root:apm-server /usr/share/apm-server/apm-server.yml | |
USER apm-server |
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
def monkey_patch_transport(): | |
from functools import wraps | |
import gzip | |
from elasticapm.transport.http import Transport | |
Transport.origin_send = Transport.send | |
@wraps(Transport.send) | |
def _(self, data): | |
print("{url: '%s', data: '%s', method: '%s', gzip: 1}" % (self._url, gzip.decompress(data.tobytes()) , 'POST')) | |
return Transport.origin_send(self, data) |
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 pyinstrument import Profiler | |
from pyinstrument.renderers import JSONRenderer | |
def pre_request(worker, req): | |
worker.profiler = Profiler() | |
worker.profiler.start() | |
def post_request(worker, req, environ, resp): |
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
use md5; | |
use std::time::SystemTime; | |
use rayon::prelude::*; | |
fn main() { | |
let now = SystemTime::now(); | |
(13200000000 as i64 .. 18900099999 as i64).into_par_iter().map( | |
|d| { | |
print!("[{:?}]{} with hash: {:?}\n", | |
SystemTime::now().duration_since(now).unwrap(), |
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
;;; diction.el --- minor mode to interface the command diction | |
;;; Copyright Sven Utcke <[email protected]> | |
;; Emacs Lisp Archive Entry | |
;; Filename: diction.el | |
;; Version: $Id: diction.el,v 1.8 2005/09/29 12:55:52 utcke Exp $ | |
;; Keywords: diction, style | |
;; Author: Sven Utcke <[email protected]> | |
;; Maintainer: Sven Utcke <[email protected]> |
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 gzip | |
import time | |
import simplejson as json | |
import websockets | |
import asyncio | |
from aioreactive.core import subscribe | |
from aioreactive.core import AsyncObservable, AsyncIteratorObserver | |
HUOBI_PRO: str = "wss://api.huobi.pro/ws" |
NewerOlder