Skip to content

Instantly share code, notes, and snippets.

View ShadowMitia's full-sized avatar
💭
Coding my problems

Dimitri Belopopsky ShadowMitia

💭
Coding my problems
View GitHub Profile
@ShadowMitia
ShadowMitia / .spacemacs
Last active March 12, 2019 22:18
My spacemacs config
;; -*- mode: emacs-lisp; lexical-binding: t -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Layer configuration:
This function should only modify configuration layer settings."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
;; `+distribution'. For now available distributions are `spacemacs-base'
@ShadowMitia
ShadowMitia / convert_svg_to_png.sh
Created November 3, 2018 18:30
Convert all svg to png
for file in $(ls *.svg); do inkscape -z -e $(basename $file | cut -d'.' -f 1).png -w 1024 -h 1024 $file; done
import re, datetime
import argparse
parser = argparse.ArgumentParser(description='Concert timestamps in file to Wordpress dates')
parser.add_argument('filename', type=str, help='File to convert')
args = parser.parse_args()
def timestamp_to_wordpress_date(timestamp):
return datetime.datetime.fromtimestamp(int(timestamp.replace('"', ''))).strftime('%Y-%m-%d %H:%M:%S')
(* Dice roller program, for r/dailyprogrammer's challenge: https://www.reddit.com/r/dailyprogrammer/comments/8s0cy1/20180618_challenge_364_easy_create_a_dice_roller/ *)
Random.self_init()
let roll_die max_val = Random.int (max_val + 1)
let process_rolls num_rolls max_range =
let rec process_rolls_rec num_rolls acc =
let roll = roll_die max_range in
match num_rolls with
open Graphics
(* union - find *)
type t = {
rank : int array;
parent : int array;
}
@ShadowMitia
ShadowMitia / autotwicht.vbs
Last active September 29, 2021 21:32
Autotwitch
Set oShell = CreateObject ("Wscript.Shell")
Dim strArgs
strArgs = "cmd /c autotwitch.bat"
oShell.Run strArgs, 0, false
#/bin/bash
xrandr --output GPU-0.DVI-D-0 --pos 0x0 --panning 0x0 --transform none --output GPU-0.HDMI-0 --pos 0x0 --panning 0x0 --transform none --output GPU-0.HDMI-1 --pos 0x0 --panning 0x0 #xrandr reset 3
xrandr --fb 3840x2160 --output GPU-0.HDMI-1 --primary --scale 2x1 --output GPU-0.HDMI-0 --scale 1x1 --output GPU-0.DVI-D-0 --pos 1920x0 --scale 1x1
@ShadowMitia
ShadowMitia / getAddons.py
Last active July 25, 2017 21:36
Get a list of openframeworks addons from github. Run in addons folder.
from subprocess import run
addons_list = [
"vanderlin/ofxBox2d",
"kr15h/ofxPiMapper",
"bakercp/ofxLight2D",
"kylemcdonald/ofxCv",
"Fatdazz/ofxBoids",
"Lacty/ofxJoystick"
]