Skip to content

Instantly share code, notes, and snippets.

View seirl's full-sized avatar

Antoine Pietri seirl

View GitHub Profile
@seirl
seirl / orc-concat.py
Created April 7, 2021 07:07
Concatenate small ORC files into a single output using PyORC
#!/usr/bin/env python3
# Copyright (c) 2021 Antoine Pietri <antoine.pietri1@gmail.com>
# SPDX-License-Identifier: GPL-3.0
import pyorc
import argparse
def main():
@seirl
seirl / talks.md
Last active October 31, 2018 21:37
Tech talks to watch
@seirl
seirl / enumhack.py
Last active March 19, 2018 16:14
Export enum hack
from enum import Enum
def export(cls):
d = {e.name: e for e in cls}
import sys
sys._getframe().f_back.f_globals.update(d)
return cls
@seirl
seirl / postgresql.md
Last active September 24, 2018 16:26
Postgresql dev setup: It's Really Not As Complicated As You're Making It Out To Be

PostgreSQL tutorials for having a quick dev setup that just works are overcomplicated. Here's what you should do in 99.99% of cases.

postgresql installation

root# apt install postgresql

creating your user

As your main user:

@seirl
seirl / blizzcon.sh
Created November 5, 2017 19:41
Download videos from the blizzcon website
#!/bin/bash
echo -n 'Enter your cookie header: '
read -s cookie_header
echo
tmpres=$( mktemp )
curl -s https://blizzcon.com/en-us/watch/videos \
| grep -o '.\+watch?[^"\]\+.\+data-video-title="[^"]\+"' \
### Keybase proof
I hereby claim:
* I am seirl on github.
* I am seirl (https://keybase.io/seirl) on keybase.
* I have a public key whose fingerprint is 225C D9E3 FA93 74BD F6E0 5704 2F89 8485 8B1A 9945
To claim this, I am signing this object:
@seirl
seirl / maze.py
Created June 13, 2017 16:07
Microbit Maze
from microbit import *
MAZE = [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1],
[1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1],
[1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1],
@seirl
seirl / aiohttp_request_body_streaming.py
Last active April 7, 2017 10:09
aiohttp: read request body with streaming
async def add_stream(request):
with open('/tmp/file', 'wb') as f:
async for chunk in request.content.iter_any():
f.write(chunk)
return web.Response(text="Done!")