Skip to content

Instantly share code, notes, and snippets.

@dbobrov
dbobrov / github-ci.yml
Created March 27, 2020 11:45
GitHub CI config [Python, Django, PostgreSQL, Redis]
# Put ci.yml file in .github/workflows
name: CI
on: push
jobs:
test:
runs-on: ubuntu-latest
container: python:3.8.2-buster
@dbobrov
dbobrov / gitlab-ci.yml
Created March 27, 2020 11:44
GitLab CI config [Python, Django, PostgreSQL, Redis]
# Put .gitlab-ci.yml file in root dir
image: python:3.8.2-buster
services:
- postgres:12
- redis:5.0
variables:
POSTGRES_DB: ci_demo
@dbobrov
dbobrov / serve.go
Last active February 19, 2021 07:40
Simple static server for development
package main
import (
"flag"
"fmt"
"log"
"net/http"
"path/filepath"
"strconv"
)
@dbobrov
dbobrov / chaotic.py
Created December 19, 2019 11:26
Chaotic is a script for generating pseudo random strings. Also it can generate cryptographically strong random strings used for passwords and tokens.
#!/usr/bin/env python3
import argparse
import random
import secrets
import string
def get_args():
p = argparse.ArgumentParser(
description="Random and secure string generator.")
@dbobrov
dbobrov / clipboard.coffee
Last active June 9, 2017 18:13
JS Clipboard
copy = (e) ->
if e.target.id isnt 'copy'
return
data = document.getElementById 'link'
data.select()
try
# TODO: remove message
successful = document.execCommand 'copy'
msg = if successful then 'successful' else 'unsuccessful'