Skip to content

Instantly share code, notes, and snippets.

@aragaer
aragaer / wall2.org
Created Oct 15, 2019
literate python - kinda
View wall2.org

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

РЕСЕТ СЕССИИ

(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 Oct 5, 2019
obs status for xmobar
View obs-status.sh
#!/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`
View ex.py
#!/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 Jun 6, 2019
yet another partitioning function for quicksort
View qsort_part.c
#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 Apr 4, 2019
Untitled Keyboard Layout
View layout.kbd.json
[
[
{
"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 Feb 17, 2019
scheme coroutines
View coro.scm
(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 Dec 28, 2018
Determine weight of each overlapping block
View overlap.py
#!/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 Dec 3, 2018
json StreamDecoder
View stream_json.py
#!/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 Nov 9, 2018
chicken goes to trello
View trello.scm
(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 Oct 30, 2018
literate programming на питоне
View wall.org

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

РЕСЕТ СЕССИИ

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

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

You can’t perform that action at this time.