Skip to content

Instantly share code, notes, and snippets.

@erenon
erenon / .config_sway_config
Created January 20, 2023 16:21
Sway sessions à la tmux
set $mode_session session [s]elect [r]ename [f]latten
bindsym $mod+s mode "$mode_session"
mode "$mode_session" {
bindsym s exec --no-startup-id ~/bin/way_select_session.py, mode "default"
bindsym r exec --no-startup-id ~/bin/way_rename_workspace.py, mode "default"
bindsym f exec --no-startup-id ~/bin/way_flatten_sessions.py, mode "default"
bindsym Escape mode "default"
bindsym Return mode "default"
}
@erenon
erenon / rewrite_rust_errors.py
Created July 19, 2022 09:39
Replace matching patterns at the specified locations
#!/bin/python
# Replace matching patterns at the specified locations
#
# On stdin it expects locations (as reported by the rustc compiler):
#
# --> path/to/file.rs:line:col
#
# Lines not matching this pattern are ignored:
@erenon
erenon / rewrite_matches.py
Created July 15, 2022 08:40
Rewrite matches
#!/bin/python
# Replace matching patterns at the specified locations
#
# On stdin it expects locations:
#
# <file_path>|<line> col <col>| match
#
# For example:
#
"""Pseudocode description of the AlphaZero algorithm."""
from __future__ import google_type_annotations
from __future__ import division
import math
import numpy
import tensorflow as tf
from typing import List
# This example shows how to use keras TensorBoard callback
# with model.train_on_batch
import tensorflow.keras as keras
# Setup the model
model = keras.models.Sequential()
model.add(...) # Add your layers
model.compile(...) # Compile as usual
@erenon
erenon / BoostEnhVectorPorp.md
Created March 14, 2015 17:05
Boost Enhanced Vector and Deque GSoC 2015 Proposal

GSoC 2015 Enhanced vector and deque containers Proposal

Personal Details

  • Name: Benedek Thaler
  • University: Budapest University of Technology and Economics
  • Course/Major: Computer Engineer, Applied Informatics
  • Degree Program: M.Sc.
@erenon
erenon / imprisoned-toroid.cpp
Created January 30, 2015 20:15
A simple raytrace program
// Imprisoned Toroid -- a simple raytrace program
// written in 2012, shared for educational purposes only.
// A (more than) slightly modified version of this program produces the following:
// https://www.youtube.com/watch?v=oYdYEcjz7_4
#include <math.h>
#include <stdlib.h>
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#include <windows.h>
@erenon
erenon / BoostPipelineProp.md
Last active August 29, 2015 13:57
Boost.Pipeline GSoC 2014 Proposal

GSoC 2014 Boost.Pipeline Proposal

Personal Details

  • Name: Benedek Thaler
  • University: Budapest University of Technology and Economics
  • Course/Major: Computer Engineer, Applied Informatics
  • Degree Program: M.Sc.
@erenon
erenon / Get-RemoteEventId.ps1
Created May 13, 2013 06:26
IRF homework snippets.
# OVERVIEW:
# parse command line
# write output header
# create filter string
# read csv -> machines
# for machine in machines
# Get-WSManInstance wmicimv2/*
# -ComputerName ...
# -Enumerate
@erenon
erenon / Crossover.asm
Created April 19, 2012 22:24
Crossover
;***************************************************************
;* Feladat: Forgalmi jelzolampa fenyerzekelo ejszakai uzemmoddal
;* Rövid leírás:
;
;* Szerzők: Thaler Benedek EDDO10
;* Mérőcsoport: CDU65
;
;***************************************************************
;* "AVR ExperimentBoard" port assignment information:
;***************************************************************