Skip to content

Instantly share code, notes, and snippets.

View rizsotto's full-sized avatar
🇺🇦
support Ukraine

László Nagy rizsotto

🇺🇦
support Ukraine
View GitHub Profile
@rizsotto
rizsotto / update.sh
Created December 5, 2018 12:17
transmission tracker update
#!/usr/bin/env bash
set -o nounset
#set -o errexit
set -o xtrace
USER=""
PASS=""
HOST="127.0.0.1:9091"
import random
import itertools
import collections
import pprint
def flip():
return bool(random.randint(0, 1))
def flips(count):
return (flip() for _ in range(0, count))
@rizsotto
rizsotto / example.yaml
Created May 1, 2017 09:26
Long running operations REST API (draft)
swagger: "2.0"
info:
title: ASYNC REST API
version: 0.0.1
contact:
name: ASYNC TEAM
url: https://example.com/
host: "example.com"
basePath: /api/v1
schemes:
@rizsotto
rizsotto / Example.scala
Created March 10, 2017 10:35
strange list fold with state monad
import scalaz.State
import scalaz._
import Scalaz._
sealed trait InputMsg{
def id: Int
}
case class Started(id: Int) extends InputMsg
case class Stopped(id: Int) extends InputMsg
@rizsotto
rizsotto / example.js
Created August 23, 2016 10:10
react exercise
class CollectionElement extends React.Component {
constructor(props) {
super(props);
this.count = props.count;
this.pos = props.pos;
}
}
class AliasWidget extends CollectionElement {
@rizsotto
rizsotto / extract.py
Last active January 26, 2023 01:52
warc files to .tar.gz
#!/usr/bin/env python
import sys
import re
import os
import os.path
import argparse
import logging
import json
import contextlib
@rizsotto
rizsotto / .vimrc
Last active August 29, 2015 14:23
my basic vim config
yntax enable
colorscheme industry
set background=dark
set encoding=utf8
set ffs=unix,dos,mac
set expandtab
set smarttab
#!/bin/sh
set -o nounset
set -o errexit
set -o xtrace
source_dir="llvm.src"
build_dir="llvm.build"
target_dir="llvm.install"
svn_update()
@rizsotto
rizsotto / differ.py
Created October 10, 2014 10:56
custom json diff tool
#!/usr/bin/env python
import json
import argparse
import multiprocessing
import datetime
import gzip
import codecs
@rizsotto
rizsotto / post_handler.py
Created July 4, 2014 11:01
HTTP POST with standard python modules
import http.server
import socketserver
import logging
import urllib.parse as p
PORT = 8000
class ServerHandler(http.server.SimpleHTTPRequestHandler):
def do_GET(self):
logging.error(self.headers)