- Set up a virtualenv
pip install flask
- add
calc_server.py
- debug/run with
python calc_server.py
(autoreloading, debugging, etc.) - Access e.g.
http://localhost:9999/calculate/9652/343
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
meikämaa | |
meikämaadoitus | |
meikämaagi | |
meikämaagikko | |
meikämaaginen | |
meikämaagisuus | |
meikämaahanpaniaiset | |
meikämaahantunkeutuminen | |
meikämaaherratar | |
meikämaahikas |
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
meikämaa | |
meikämaagi | |
meikämaagikko | |
meikämaahanhyökkäys | |
meikämaahanlasku | |
meikämaahanlyönti | |
meikämaahanmeno | |
meikämaahanmuuttaja | |
meikämaahanmuutto | |
meikämaahanpaniainen |
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
Meikämaa | |
Meikämaagi | |
Meikämaagikko | |
Meikämaahinen | |
Meikämaalainen | |
Meikämaalari | |
Meikämaali | |
Meikämaallikko | |
Meikämaanantai | |
Meikämaanikko |
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 orjson | |
from rest_framework.utils import encoders | |
from rest_framework import renderers | |
json_default_encode = encoders.JSONEncoder().default | |
class ORJSONRenderer(renderers.JSONRenderer): | |
def render(self, data, accepted_media_type=None, renderer_context=None): | |
if data is None: |
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 os | |
import datetime | |
import glob | |
import subprocess | |
import json | |
def get_creation_time(f): | |
rinfo = subprocess.check_output('ffprobe -print_format json -hide_banner -show_format -i "%s"' % f, shell=True, stderr=subprocess.DEVNULL) | |
info = json.loads(rinfo.decode()) | |
ctime = info['format']['tags']['creation_time'] |
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
ffmpeg \ | |
-video_size 1200x400 \ | |
-framerate 30 \ | |
-f x11grab \ | |
-i :0.0+0,0 \ | |
-pix_fmt yuv420p \ | |
-filter_complex " | |
color=size=800x800:c=black [base]; | |
[0:v] setpts=PTS-STARTPTS, crop=w=800:h=400:x=0:y=0 [row1]; | |
[0:v] setpts=PTS-STARTPTS, crop=w=400:h=400:x=800:y=0 [row2]; |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
static long long ts_usecs(struct timespec t) { | |
return (t.tv_sec * 1000000000 + t.tv_nsec); | |
} | |
int main() { | |
struct timespec t0, t1; |
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
// h/t @japsu for the idea. had to type it. | |
import React from "react"; | |
function connect<C, P>( | |
ContextClass: React.Context<C>, | |
propName: keyof P, | |
): (( | |
component: React.FunctionComponent<P> | React.ComponentClass<P>, | |
) => React.FunctionComponent<P>) { |
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 python3 | |
import json | |
import sys | |
class c2j: | |
def __init__(self): | |
self.stack = [] | |
self.root = None |