Skip to content

Instantly share code, notes, and snippets.

View AnyTimeTraveler's full-sized avatar

Simon Struck AnyTimeTraveler

  • Somewhere, but not here.
View GitHub Profile
@AnyTimeTraveler
AnyTimeTraveler / pmu.c
Created October 27, 2021 17:42
Waking from sleep using a timer doesn't work after the LPC11u68 has been in deep sleep
/*
* @brief PMU example
*
* @note
* Copyright(C) NXP Semiconductors, 2013
* All rights reserved.
*
* @par
* Software that is described herein is for illustrative purposes only
* which provides customers with programming information regarding the
@AnyTimeTraveler
AnyTimeTraveler / ConcurrentLinkedQueueExample.java
Created March 31, 2021 13:31
ConcurrentLinkedQueue Example in Java
import java.util.concurrent.ConcurrentLinkedQueue;
public class Queues {
private static final ConcurrentLinkedQueue<Integer> queue = new ConcurrentLinkedQueue<>();
private static boolean running = true;
public static void main(String[] args) throws InterruptedException {
new Thread(Queues::produce).start();
new Thread(Queues::consume).start();
@AnyTimeTraveler
AnyTimeTraveler / teestube.py
Created February 19, 2020 21:52
A module for i3pystatus to show if the Teestube at the student houseing Dukegat is open or closed.
from i3pystatus import IntervalModule
import requests
class Teestube(IntervalModule):
"""
Shows if the Teestube is open or closed
Requires requests
"""
open_text = "TS Open"
@AnyTimeTraveler
AnyTimeTraveler / nasmtags.sh
Last active November 28, 2019 17:37
Very simple script that generates vim-tags for nasm labels
#!/bin/bash
echo "" > tags
for text in $(grep -oP '^(\w+):' $1 -n); do
line=$(echo $text | cut -d: -f 1)
symbol=$(echo $text | cut -d: -f 2)
echo -e "$symbol\t$1\t$line" >> tags
done
cd /tmp/
# Till the date of publication of this script, the latest available download version is the 0.8.0
wget -c https://github.com/ogham/exa/releases/download/v0.8.0/exa-linux-x86_64-0.8.0.zip
unzip exa-linux-x86_64-0.8.0.zip
# Move the unziped binary with the name "exa-linux-x86_64" to "/usr/local/bin/" with the exa name
if [ $(id -u) -eq 0 ]; then
mv exa-linux-x86_64 /usr/local/bin/exa
@AnyTimeTraveler
AnyTimeTraveler / giffer.sh
Created February 8, 2019 02:00
A simple script that uses imagemagick to turn a series of files into a gif.
#!/bin/bash
if [ "$#" -lt 3 ]; then
echo "Usage: [speed] [output file name] [files...]"
exit -1
fi
mkdir gif
cd gif
echo -n "Copying..."
@AnyTimeTraveler
AnyTimeTraveler / journal.sh
Last active January 12, 2019 20:43
A small script that manages your diary. Put it into a folder, initialize a git repository there and push it to a remote. The rest will be done by the script.
#!/bin/sh
# Get your own path
path=$(dirname $(realpath $0))
# Make sure that git uses the path of the script and not the current directory
git="git --work-tree=$path --git-dir=$path/.git/"
# Get today's date
day="$(date +'%d')"
@AnyTimeTraveler
AnyTimeTraveler / screens.py
Last active January 14, 2018 14:50
A script that organizes your dual screen setup automatically
#!/bin/python3
import re
import subprocess
import sys
##############################################
# Multi Monitor setup script by Simon Struck #
##############################################