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 | |
let now = (date now) | |
let week = ($now | format date '%V' | str trim -l -c '0') | |
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 -a "\n(\n|(;|\\())" "$2" | # fix bullshit |
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) |
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
#include <cstdint> | |
#include <fmt/format.h> | |
int main() | |
{ | |
union { | |
uint32_t i; | |
uint8_t a[4]; | |
struct { uint32_t lsb:6, m:20, msb:6; } 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
#pragma once | |
#include <optional> | |
#include <map> | |
/* | |
#define <GENERATOR>(XX) \ | |
XX(OK, 0) \ | |
XX(ERROR, 1) \ | |
XX(..., ...) \ |
NewerOlder