This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nu | |
def ind [level: int = 2, symbol: string = " "] { | |
mut id = '' | |
if $level > 0 { # fix for single runs of 1..0 | |
for i in 1..$level { | |
$id += $symbol | |
} | |
} | |
$id + $in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io::Write; | |
use icalendar::{self as ical, Component, DatePerhapsTime, EventLike}; | |
use csv; | |
use chrono::{DateTime, Utc}; | |
use serde::Deserialize; | |
#[derive(Deserialize)] | |
struct Event { | |
summary: String, | |
description: Option<String>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# Example: cat index.html | ./slight.fish html | |
# cat main.c | ./slight.fish c | |
set -l syntax $argv[1] | |
exec kate-syntax-highlighter /dev/stdin \ | |
--syntax $syntax \ | |
--output-format ansi256Colors \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nu | |
def fetch [week: int] { | |
let url = $"https://www.stwno.de/infomax/daten-extern/csv/HS-R-tag/($week).csv" | |
( | |
http get --raw $url | |
| decode "iso-8859-1" | |
| str replace --regex "\n(\n|(;|\\())" "$2" # fix bullshit | |
| from csv -s ";" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
# You need sway, swaylock, grim, imagemagick, jq and parallel. | |
set SCREEN (swaymsg -t get_outputs | jq -r .[].name) | |
for s in $SCREEN; | |
set -l img /tmp/lock-$s.jpg | |
set -a IMG $img | |
set -a PARAMS "-i $s:$img" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use reqwest; | |
use scraper::{Html, Selector}; | |
use structopt::{self, StructOpt}; | |
#[derive(StructOpt)] | |
#[structopt(name = "w0bm-sav0r")] | |
struct Opt | |
{ | |
#[structopt()] | |
username: String, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env fish | |
set file_name_base (date "+%Y-%m-%d_%H-%M-%S") | |
#set url "http://example.com" | |
#set uploader "rsync" | |
#set uploader_target "server:/srv/http/" | |
if [ $WAYLAND_DISPLAY ]; | |
set IS_WAYLAND 1 | |
set SEL_CMD 'slurp' -d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef __AVR_ATmega328P__ | |
# define __AVR_ATmega328P__ // IDE helper | |
#endif | |
#include <Arduino.h> | |
struct cmd_pair | |
{ | |
const char *query, *response, *err; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <iterator> | |
template<class Iter> | |
struct Range | |
{ | |
using value_type = typename std::iterator_traits<Iter>::value_type; | |
Range(Iter b): b(b) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# general dependencies: | |
# bash (to run this script) | |
# util-linux (for getopt) | |
# procps or procps-ng | |
# hostapd | |
# iproute2 | |
# iw | |
# iwconfig (you only need this if 'iw' can not recognize your adapter) |
NewerOlder