I hereby claim:
- I am marnitto on github.
- I am marnitto (https://keybase.io/marnitto) on keybase.
- I have a public key ASAPkSINNBP-P2KTbzhJA78QuARLUb-hYILfD6DFj2i0Lwo
To claim this, I am signing this object:
# -*- coding: utf-8 -*- | |
# HTTP POST request example to resolve post size bug in Jython. | |
# | |
# Jython from 2.7.1 can't use synchronous socket to send data more than | |
# 65536 bytes at once (sends first socket and blocks infinitely), because | |
# jython didn't catch if socket.sendall() sends successfully. This bug was | |
# reported at 2017 but until now(2021.2.) there is no official fix, so | |
# instead of waiting I made a simple script using Java's native | |
# `java.net.URLConnection` class. |
# -*- coding: utf-8 -*- | |
import inspect | |
def get_context(): | |
# *crawl* hidden context variable from stack frame | |
for fi in inspect.getouterframes(inspect.currentframe()): | |
local = fi.frame.f_locals | |
context = local.get('context') |
I hereby claim:
To claim this, I am signing this object:
FROM ubuntu:16.04 | |
MAINTAINER [email protected] | |
ENV DEBIAN_FRONTEND noninteractive | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
sudo wget git python make ca-certificates && \ | |
wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py && \ | |
python /tmp/get-pip.py | |
# symgdb installation step from symgdb repo |
# -*- coding: utf-8 -*- | |
import codecs | |
from bs4 import BeautifulSoup | |
import requests | |
html = requests.get('https://slackmojis.com/').text | |
soup = BeautifulSoup(html, 'html.parser') |
# Tested on Windows 7~, Python 2.7 and 3.6. | |
# | |
# -*- coding: utf-8 -*- | |
import subprocess | |
import operator | |
res = subprocess.check_output(['tasklist']) | |
res = res.split(b'\r\n')[2:] |
def show_me_the_hand(records): | |
try: | |
class AF(str): # for p2 | |
def __eq__(self, *args, **kwarg): | |
return False | |
def __ne__(self, *args, **kwarg): | |
return True | |
class OTF(str): # for p1 |
# -*- coding: utf-8 -*- | |
# | |
# Slack file downloader from export archive | |
# | |
# Requirements: | |
# Python 2 (or Python3 if you can use six) | |
# | |
# How to use: | |
# 1. Log in as admin, export your chat logs, and download archive. | |
# 2. Unarchive archive to directory (ex. TeamName export Apr 24 2016) |
# -*- coding: utf-8 -*- | |
# Tested on z3 4.4.0, Python 2.7.9 | |
# | |
# $ time python sudoku.py | |
# 5 3 4 6 7 8 9 1 2 | |
# 6 7 2 1 9 5 3 4 8 | |
# 1 9 8 3 4 2 5 6 7 | |
# 8 5 9 7 6 1 4 2 3 | |
# 4 2 6 8 5 3 7 9 1 |
# -*- coding: utf-8 -*- | |
import datetime | |
import os | |
import time | |
import github | |
import irc.bot | |
import schedule |