Skip to content

Instantly share code, notes, and snippets.

View mskrajnowski's full-sized avatar

Marek Skrajnowski mskrajnowski

View GitHub Profile
@mskrajnowski
mskrajnowski / auto-tag-releases.sh
Created December 2, 2021 12:46
Create version tags and GitHub releases based on merges to a main branch
#!/usr/bin/env bash
set -euo pipefail
branch=main
initial_sha=SHA_OF_THE_FIRST_RELEASE
initial_version=1
version_tag () {
version=$1
@mskrajnowski
mskrajnowski / 99-trackpoint.conf
Created March 7, 2020 14:06
X11 disable trackpoint on Toshiba Z30-A
Section "InputClass"
Identifier "Disable trackpoint"
MatchProduct "AlpsPS/2 ALPS DualPoint Stick"
Option "Ignore" "on"
EndSection
@mskrajnowski
mskrajnowski / stream_logger.py
Created June 23, 2015 10:01
Stream write logger
import traceback
class WriteLogger(object):
def __init__(self, stream):
self.stream = stream
def write(self, str):
stack = traceback.extract_stack()
stack_lines = traceback.format_list(stack[:-1])
@mskrajnowski
mskrajnowski / flames.py
Last active December 6, 2018 11:20
Flamegraph django middleware
"""
Django middleware for generating request flame graphs.
Requires the flamegraph.pl perl script:
https://github.com/brendangregg/FlameGraph/blob/master/flamegraph.pl
Installation:
1. Create a directory for flame graphs
2. Copy the flamegraph.pl script to it
3. Add the FLAMES_DIR django setting
4. Add the flames.FlamesMiddleware to MIDDLEWARE_CLASSES
@mskrajnowski
mskrajnowski / ng-route-web-components-crash.html
Created April 20, 2015 12:12
angular-route + web-components crash - Chrome 42.0.2311.90
<!DOCTYPE html>
<html>
<body ng-app="app">
<ng-view></ng-view>
<template id='my-component-template'>
<style>
@import url('whatever...');
</style>
</template>
@mskrajnowski
mskrajnowski / gifenc.py
Created April 16, 2015 12:19
Video to GIF conversion script using ffmpeg
"""
Video to GIF conversion script using ffmpeg
based on http://blog.pkh.me/p/21-high-quality-gif-with-ffmpeg.html
"""
import argparse
import datetime
import os
import subprocess
import tempfile