Skip to content

Instantly share code, notes, and snippets.

@aragaer
aragaer / wall2.org
Created October 15, 2019 17:29
literate python - kinda

Подготовительные вещи

РЕСЕТ СЕССИИ

(setq kill-buffer-query-functions
      (remq 'process-kill-buffer-query-function
            kill-buffer-query-functions))
(kill-buffer "wall")

Сначала надо выставить правильный virtualenv

@aragaer
aragaer / obs-status.sh
Created October 5, 2019 21:35
obs status for xmobar
#!/bin/bash
LOGS=/home/aragaer/.config/obs-studio/logs/
get_status() {
result='---'
OBSPID=`ps ax | awk '\$5=="obs"{print \$1}'`
for pid in $OBSPID; do
file=`readlink -f /proc/$pid/fd/6`
#!/usr/bin/env python3
def make_container_for(key):
if isinstance(key, int):
return [None] * (key+1)
else:
return {}
def build(val, path):
for key in reversed(path):
@aragaer
aragaer / qsort_part.c
Last active October 23, 2023 22:55
yet another partitioning function for quicksort
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
//#define DEBUG
int compares = 0, swaps = 0;
void dumps(void *d, int c) {
int i;
@aragaer
aragaer / layout.kbd.json
Created April 4, 2019 06:09
Untitled Keyboard Layout
[
[
{
"a": 7
},
"<i class='badger badger-badger'></i>",
"<i class='badger badger-badger'></i>",
"<i class='badger badger-badger'></i>",
"<i class='badger badger-badger'></i>",
"<i class='badger badger-badger'></i>",
@aragaer
aragaer / coro.scm
Created February 17, 2019 01:13
scheme coroutines
(define (msg-type msg)
(cdr (assoc 'type msg)))
(define (msg-class msg)
(cdr (assoc 'class msg)))
(define (msg-data msg)
(cdr (assoc 'data msg)))
(define (msg-cmd msg)
@aragaer
aragaer / overlap.py
Created December 28, 2018 11:16
Determine weight of each overlapping block
#!/usr/bin/env python
import argparse
import glob
import os
import sys
import numpy as np
from PIL import Image
@aragaer
aragaer / stream_json.py
Created December 3, 2018 12:11
json StreamDecoder
#!/usr/bin/env python3
import json
class StreamDecoder(json.JSONDecoder):
def __init__(self, *args, buf=None, **kwargs):
super().__init__(*args, **kwargs)
self.buf = buf or [""]
@aragaer
aragaer / trello.scm
Last active November 9, 2018 08:26
chicken goes to trello
(use json)
(use posix)
(use utils)
(require-extension srfi-13)
(require-extension srfi-18)
(require-extension srfi-19)
(define api-key '())
(define token '())
@aragaer
aragaer / wall.org
Last active October 30, 2018 19:48
literate programming на питоне

Подготовительные вещи

РЕСЕТ СЕССИИ

(setq kill-buffer-query-functions
      (remq 'process-kill-buffer-query-function
            kill-buffer-query-functions))
(kill-buffer "wall")

Сначала надо выставить правильный virtualenv