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 __future__ import annotations | |
from dataclasses import dataclass, field | |
from typing import Any, Callable, Hashable, List, Optional | |
import google.auth | |
import httplib2 | |
import structlog | |
from google_auth_httplib2 import AuthorizedHttp | |
from googleapiclient.http import HttpRequest |
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 subprocess | |
import warnings | |
from typing import List, Optional | |
import google.auth | |
import google.auth.iam | |
import google.oauth2.credentials | |
import structlog | |
from google.auth.credentials import Credentials | |
from google.auth.transport import requests |
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 json | |
import time | |
import click | |
import googleapiclient.discovery | |
import googleapiclient.errors | |
@click.command("create") | |
@click.argument("name") |
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
-- Plain function for baseline | |
local func = function(x) | |
return x | |
end | |
-- Closure | |
local IClass = function(id) | |
local foo = function() | |
return id | |
end |
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 python:3.7.2-alpine AS builder | |
RUN apk add --no-cache --virtual .build-deps \ | |
build-base \ | |
libffi-dev \ | |
openssl-dev \ | |
linux-headers | |
ENV PYROOT /pyroot | |
ENV PATH $PYROOT/bin:$PATH |
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
$ python bug-subscribe-and-do-nothing.py | |
2019-01-15T00:14:01 Entering re-connect loop | |
2019-01-15T00:14:01 trying transport 0 using connect delay 0 | |
2019-01-15T00:14:01 connecting once using transport type "websocket" over endpoint "tcp" | |
2019-01-15T00:14:02 | |
[('logOctets', False, 'WampWebSocketClientFactory'), | |
('logFrames', False, 'WampWebSocketClientFactory'), | |
('trackTimings', False, 'WampWebSocketClientFactory'), | |
('utf8validateIncoming', True, 'WampWebSocketClientFactory'), | |
('applyMask', True, 'WampWebSocketClientFactory'), |
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
# NOTE: This is a really quick & dirty version | |
FROM openresty/openresty:1.13.6.2-0-alpine-fat | |
RUN apk add --no-cache cmake openssl-dev git | |
RUN /usr/local/openresty/luajit/bin/luarocks install wiola 0.9.1-2 | |
CMD ["/usr/local/openresty/bin/openresty"] |
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 | |
import os | |
import subprocess | |
import argparse | |
import json | |
from oauth2client.client import GoogleCredentials | |
from googleapiclient import discovery |
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 python:3.5-alpine | |
ADD https://gist.githubusercontent.com/haizaar/607f43e282c4e0f8737a/raw/1145c89b5aa34e2ec7afe32fb9d0e27661c7debd/mem_loader.pyy mem_loader.py | |
CMD python -u mem_loader.py |
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 python:3.5-alpine | |
ADD https://gist.github.com/haizaar/91469f5c4dfdef1f1965/raw/702e42eefa28d2b81ffd09990edf61035f51638f/cpu_loader.py cpu_loader.py | |
CMD nice -n ${NICENESS:-0} python -u cpu_loader.py |
NewerOlder