Skip to content

Instantly share code, notes, and snippets.

@conformist-mw
conformist-mw / online_radio.m3u
Created November 17, 2021 20:56
Online radio stations playlist
#EXTM3U
#PLAYLIST:Online Radio
#EXTINF:-1,KissFM - KissFM
https://online.kissfm.ua/KissFM
#EXTINF:-1,KissFM - KissFM Deep
https://online.kissfm.ua/KissFM_Deep
#EXTINF:-1,KissFM - KissFM Black
https://online.kissfm.ua/KissFM_Black
#EXTINF:-1,KissFM - KissFM Trendz
l = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30]
a = ['a','b','c','d','e','f']
for step in range(1, 6):
step_result = []
letters = iter(cycle(a))
for index, num in enumerate(l, 1):
step_result.append(num)
if not index % step:
step_result.append(next(letters))
import sys
import logging
from django.utils import termcolors
def exception_hook(exc_type, exc_value, exc_traceback):
# Log unhandled exceptions with time
if issubclass(exc_type, KeyboardInterrupt):
sys.__excepthook__(exc_type, exc_value, exc_traceback)
@conformist-mw
conformist-mw / 500.html
Last active April 4, 2021 09:03
django custom error pages
{% extends 'errors/base_error.html' %}
{% block error_class %}is-danger{% endblock %}
{% block error_title %}500 Internal Server error{% endblock %}
{% block error_subtitle %}Something awful just happened. Don't do this again.{% endblock %}
import logging
class SQLFormatter(logging.Formatter):
"""
https://markusholtermann.eu/2016/01/syntax-highlighting-for-djangos-sql-query-logging/
"""
def format(self, record):
# Check if Pygments is available for coloring
try:
@conformist-mw
conformist-mw / chromePerfLogsHAR.js
Created May 29, 2020 11:05 — forked from Ankit3794/chromePerfLogsHAR.js
This Javascript file can be loaded in browser and calling module.getHarFromMessages() is returing HAR by passing Performance Logs as argument
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.module = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
},{}],2:[function(require,module,exports){
// shim for using process in browser
var process = module.exports = {};
// cached from whatever global is present s
@conformist-mw
conformist-mw / Dockerfile.dev
Created February 2, 2020 20:26 — forked from alvarocavalcanti/Dockerfile.dev
Configuring Python Remote Interpreter using Docker
FROM python:3.7
ENV PYTHONUNBUFFERED 1
WORKDIR /code
# Copying the requirements, this is needed because at this point the volume isn't mounted yet
COPY requirements.txt /code/
# Installing requirements, if you don't use this, you should.
# More info: https://pip.pypa.io/en/stable/user_guide/
@conformist-mw
conformist-mw / git-aliases.md
Last active August 18, 2018 11:13 — forked from mwhite/git-aliases.md
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@conformist-mw
conformist-mw / python-on-ubuntu.sh
Created July 27, 2018 07:09 — forked from neuroticnerd/python-on-ubuntu.sh
Python 2.7.9 on Ubuntu 14.04.2 (without overwriting original version)
#! /usr/bin/env bash
# http://smirnov-am.blogspot.com/2015/04/installation-of-python-279-in-ubuntu.html
# http://davebehnke.com/python-pyenv-ubuntu.html
# https://renoirboulanger.com/blog/2015/04/upgrade-python-2-7-9-ubuntu-14-04-lts-making-deb-package/
# install dependencies
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
@conformist-mw
conformist-mw / .screenrc
Last active July 23, 2018 13:24 — forked from joaopizani/.screenrc
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off