I hereby claim:
- I am pschwede on github.
- I am pschwede (https://keybase.io/pschwede) on keybase.
- I have a public key whose fingerprint is 88C7 BA17 B793 BF47 D82F 326D EFBC 00FF 3636 8FDB
To claim this, I am signing this object:
#nanojam Nuclear Pilot | |
if ¬t | |
// World init | |
player = {pos: xy(32,32), vel: xy(0,0), acc: 0.01} | |
landing = {pos: xy(32, 32)} | |
// Player | |
sprayOn = 0 |
I hereby claim:
To claim this, I am signing this object:
read -p"Hit Space key at each beat (8x): " -n2; /usr/bin/time -f '%e' -- bash -c "read -n6" |& awk '/\./ {printf("%f\n", 6*60/$0)}' |
#!/usr/bin/env python | |
"""Freqently modifies XFCE4 Terminal config to present a different cursor | |
color.""" | |
from colorsys import hsv_to_rgb | |
import ConfigParser | |
import time | |
#!/bin/bash | |
### Remind me to drink a glass every two hours. | |
# WHO recommends 3 Liters per day. I am abound 16 hours awake. My glass can hold 0.4 Liters. | |
# 400ml / (3l / 16h) = 2.133h; which would include a factor of savety of 1.07 ;) | |
### | |
while true; do | |
notify-send "drink a drink"; | |
sleep $(echo "7200 - 3600*("$(date +%k)" % 2) - 60*("$(date +%M)") - "$(date +%S) | bc) |
# This is an example to show how to access a set of variables named e. g. by an iterable during an iteration. | |
# | |
# BE WARNED: The following coding strategy is not easy to debug! | |
# | |
# Some like to generate variables, rather than having just one list of all data sets. | |
# That way you get an introspectable object for each data set – which particularly eases debugging in RStudio. | |
# To create variables in a loop or other generative iterations R provides paste(), assign() and get(). | |
# * With paste(), you can concatenate strings. (Use it to compose variable names.) | |
# * With assign(), you can give variables a value using their name in a string and of course the value you give. | |
# * With get() you can access such named variables using the sting. |
#!/usr/bin/env python3 | |
""" | |
(c) 2015 pschwede | |
Solutions to 5 problems every programmer should be | |
able to solve in less than 1 hour. | |
""" | |
# https://blog.svpino.com/2015/05/07/five-programming-problems-every-software-engineer-should-be-able-to-solve-in-less-than-1-hour # noqa | |
from itertools import product |
def to_value(string): | |
"""Converts a string to the value it represents. | |
If a non-string has been given, it stays as it is. | |
Examples: | |
>>> to_value("foobar") | |
"foobar" | |
>>> to_value(12345) | |
12345 | |
>>> to_value("12345") |
#!/bin/bash | |
# | |
# ======================================== | |
# Diff recursively and then render the identity relation between the files using graphviz circo. | |
# ======================================== | |
# | |
# Go to a folder with your subdirectories you want to compare, then call "diff_circo". | |
# | |
# Copyright (c) 2015, Peter Schwede [email protected] | |
# |
#!/bin/bash | |
zenity --question --text='Shutdown?' && dbus-send --system --print-reply --dest='org.freedesktop.ConsoleKit' /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop |