Skip to content

Instantly share code, notes, and snippets.

View Kilobyte22's full-sized avatar

Stephan Henrichs Kilobyte22

View GitHub Profile
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active May 14, 2024 08:25
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
#!/bin/bash
title=$(dmenu -p 'password title: ' < /dev/null)
if [[ "$title" != "" ]]; then
if [[ -f ~/.password-store/"$title".gpg ]]; then
ans=$(echo -e 'no\nyes' | dmenu -p 'answer: ' -mesg 'Password exists, do you want to overwrite?' -only-match)
if [[ "$ans" == yes ]]; then
pass generate -f -c "$title" 30 && \
notify-send "Password Store" "Password generated"
@IntergalacticApps
IntergalacticApps / make_windows10_great_again.bat
Last active December 28, 2023 08:16
Make Windows 10 Great Again - stop Windows 10 spying!
@echo off
setlocal EnableDelayedExpansion
ver | find "10." > nul
if errorlevel 1 (
echo Your Windows version is not Windows 10... yet. Brace yourself, Windows 10 is coming^^!
pause
exit
)
anonymous
anonymous / playground.rs
Created April 2, 2016 20:31
Shared via Rust Playground
struct ParseState {
stack: Vec<u64>,
num: Option<u64>
}
fn flush_state(state: &mut ParseState) {
match state.num {
Some(x) => state.stack.push(x),
None => {}
}
@Kilobyte22
Kilobyte22 / ping.pl
Last active December 11, 2015 11:51
#!/bin/perl
# i3blocks script to display current ping
# Licensed under the MIT license
use strict;
use warnings;
sub ping {
my $host = shift;
anonymous
anonymous / gfm.lua
Created January 15, 2015 00:15
------------
-- CONFIG --
------------
output="%s | %s | %s" -- First %s is amount (no $ sign)
-- Second %s is name
-- Third %s is message ('No message' if none)
waitTime=60 -- Time between grabbing new data
outputFile="out.txt" -- Output filename
----------------
anonymous
anonymous / untrusted-lvl10-solution.js
Created May 5, 2014 18:42
Solution to level 10 in Untrusted: http://alex.nisnevich.com/untrusted/
/*************
* ambush.js *
*************
*
* Oh. Oh, I see. This wasn't quite part of the plan.
*
* Looks like they won't let you take the Algorithm
* without a fight. You'll need to carefully weave your
* way through the guard drones.
*
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
=begin
Script to upload screenshots one a press of a button
warning: for this script you need the 'ruby-dbus' gem, also, this will most likely never work on Windows or OSX. Its written for linux after all. By default it utilizes KDE tools. i'll happily add more if requested.
LICENSE: GPL
=end
CFGNAME = "#{Dir.home}/.uploadscreenshot.yml"
require 'dbus'
@dzmitryk
dzmitryk / pkcs5.c
Last active February 23, 2022 15:09
Simple command line tool to demonstrate using of PKCS#5 PBKDF2 HMAC SHA1 capabilities of OpenSSL library.Params: -i number of iterations; -s salt; -p password; -l hash length; -x flag which allows to specify salt as hex string;Compile using: $gcc pkcs5.c -L/usr/lib -lssl -lcrypto -o pkcs5
/*
MIT License
Copyright (c) 2013 Dzmitry Kazimirchyk
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is