Skip to content

Instantly share code, notes, and snippets.

View DFilyushin's full-sized avatar
🍓
Python, MSA, Rabbitmq

Dmitriy Filyushin DFilyushin

🍓
Python, MSA, Rabbitmq
View GitHub Profile
@mariuz
mariuz / DriverExample.java
Created June 23, 2011 19:54
Firebird driver example using jaybird-full jar
// Original version of this file was part of InterClient 2.01 examples
//
// Copyright InterBase Software Corporation, 1998.
// Written by com.inprise.interbase.interclient.r&d.PaulOstler :-)
//
// Code was modified by Roman Rokytskyy to show that Firebird JCA-JDBC driver
// does not introduce additional complexity in normal driver usage scenario.
//
// A small application to demonstrate basic, but not necessarily simple, JDBC features.
//
@JalfResi
JalfResi / revprox.go
Last active July 26, 2024 15:18
Simple reverse proxy in Go
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@agconti
agconti / example_locustfile.py
Last active May 5, 2022 00:49
Example Locustfile Keywords: Locustfile.py. Locust, LocistIo.
from locust import HttpLocust, TaskSet, task
class MostBasicLoadTest(TaskSet):
def on_start(self):
""" on_start is called when a Locust start before any task is scheduled """
self.login()
def login(self):
self.client.post("/api/api-token-auth/",
{
Development Status :: 1 - Planning
Development Status :: 2 - Pre-Alpha
Development Status :: 3 - Alpha
Development Status :: 4 - Beta
Development Status :: 5 - Production/Stable
Development Status :: 6 - Mature
Development Status :: 7 - Inactive
Environment :: Console
Environment :: Console :: Curses
Environment :: Console :: Framebuffer
@kgriffs
kgriffs / uuid_regex.py
Last active September 28, 2023 19:03
UUID regular expressions (regex) with usage examples in Python
import re
# RFC 4122 states that the characters should be output as lowercase, but
# that input is case-insensitive. When validating input strings,
# include re.I or re.IGNORECASE per below:
def _create_pattern(version):
return re.compile(
(
'[a-f0-9]{8}-' +
@TySkby
TySkby / timeout.py
Last active June 5, 2024 17:06
Timeout decorator/context manager using signals (for Python 3)
#!/usr/bin/env python3
"""Easily put time restrictions on things
Note: Requires Python 3.x
Usage as a context manager:
```
with timeout(10):
something_that_should_not_exceed_ten_seconds()
```
# Put it to .github/workflows/stale.yml
name: Close stale issues and pull requests
on:
workflow_dispatch:
schedule:
- cron: '30 1 * * *'
jobs:
stale: