Skip to content

Instantly share code, notes, and snippets.

View pyohei's full-sized avatar
🏯
I'm in Himeji.

Shohei Mukai pyohei

🏯
I'm in Himeji.
View GitHub Profile
@miyagawa
miyagawa / README.md
Last active May 12, 2018 15:30
Rebuild チャプター

Rebuild のチャプターは ep181 以降からつけているため、ep180 以前のものにはついていません。膨大な数になり、手作業でつけることになるため、ボランティアでご協力していただける方を募集しています。

Show Notes と比較しながら早回し、スキップしてすすめると、1エピソードあたり5-20分程度の作業になります。Show Notes にあるリンクは非常に粒度が細かくなってしまうので、大きなトピックでまとめて1つのタグぐらいで構いません。

以下のフォーマットで .txt ファイルを作成し、

00:00 Intro
01:23 トピック1
32:44 トピック2
@ks888
ks888 / mitmproxy_replace_host.py
Created May 4, 2017 05:02
mitmproxy_replace_host.py
import argparse
import sys
from mitmproxy import ctx
class Replacer:
def __init__(self, src, dst):
self.src, self.dst = src, dst
def request(self, flow):
if flow.request.host == self.src:
@echo off
chdir %*
set BRANCH=
for /f "eol=; tokens=1,2 delims== " %%i in ('"git branch 2>NUL"') do if "%%i"=="*" set BRANCH=%%j
if "%BRANCH%" neq "" (
set PROMPT=$P^(%BRANCH%^)$G
) else (
set PROMPT=$P$G
)
@ashishtajane
ashishtajane / django urlpattern list .py
Last active May 13, 2024 02:08
Get all URL patterns in django
# Open django shell and do following.
import urls
def show_urls(urllist, depth=0):
for entry in urllist:
print(" " * depth, entry.regex.pattern)
if hasattr(entry, 'url_patterns'):
show_urls(entry.url_patterns, depth + 1)
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 14, 2024 18:19
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request: