Skip to content

Instantly share code, notes, and snippets.

View bewuethr's full-sized avatar

Benjamin Wuethrich bewuethr

View GitHub Profile
// Chapter 12, exercise 01: draw rectangle as Rectangle and Polygon
#include "../lib_files/Simple_window.h"
#include "../lib_files/Graph.h"
// draw rectangle as Rectangle (blue) and as Polygon (red)
void ex01(Simple_window& win)
{
Graph_lib::Rectangle rect(Point(100,100),150,100);
rect.set_color(Color::blue);
@bewuethr
bewuethr / scrabble.pl
Last active June 21, 2016 22:53
Scrabble task from codingame - requires too much memory, but too nice to throw away
#!/usr/bin/perl
# Reads number of words $n from first line of input, the $n words and finally
# the scrabble letters provided. Using a smart grep and a Schwartzian Transform,
# the list of words is filtered (possible to be built from letters provided?)
# and then sorted by a) scrabble score and b) order of appearance in list.
use strict;
use warnings;
use 5.020;
@bewuethr
bewuethr / .slrnrc
Created August 4, 2017 05:07
Colour configuration for slrn that works with solarized dark
% Solarized colours for slrn
color article default default
color author default default bold
color boldtext default default bold
color box default black
color cursor brown black
color date green default
color description brightblue default
color error red default
color frame white blue
@bewuethr
bewuethr / dfinit
Last active November 11, 2023 18:13
Dotfiles initialization script
#!/usr/bin/env bash
while getopts 'l:' opt; do
case $opt in
l) branch=$OPTARG ;;
*) exit 1 ;;
esac
done
if [[ -n $branch ]]; then
@bewuethr
bewuethr / partial-rebase.md
Last active July 3, 2023 18:55
Partially rebasing a branch

Rebasing branches partially in Git

Situation

Feature branch feature1 is cut from development:

---o---o---o      <-- development
    \
 A---B---C &lt;-- feature1
on:
push:
jobs:
print:
runs-on: ubuntu-latest
steps:
- run: echo "Running!"
@bewuethr
bewuethr / github.md
Last active May 22, 2022 18:43
Math test

Math test

Cauchy's Theorem

Let $U$ be an open subset of the complex plane $\mathbb{C}$, and suppose the closed disk $D$ defined as

$$ D = {z:|z-z_{0}|\leq r} $$

@bewuethr
bewuethr / summary.md
Created May 21, 2023 21:47
A details tag with a Markdown link