Skip to content

Instantly share code, notes, and snippets.

@bysse
bysse / convert_credentials.py
Created November 29, 2021 12:46
Convert Dashlane CSV to Bitwarden CSV format
#!/bin/python3
import sys
import urllib.parse
# Folder for uncategorized credentials
import_folder = "Dashlane"
with open("credentials.csv") as fp:
data = [[y.strip() for y in x.strip().split(",")] for x in fp.readlines()]
@bysse
bysse / getinput.sh
Last active December 3, 2020 07:46
AoC get input script
#!/bin/bash
if [ -z "$1" ]; then
echo "Missing day number as argument!"
exit 1
fi
SESSION=""
DAY="$1"
YEAR="2020"
@bysse
bysse / Makefile
Last active December 1, 2020 19:48
AdventOfCode 2020 day 1 - 64bit assembly no libc
day1: build/day1.o
ld -s build/day1.o -o day1
build/%.o: %.asm build
nasm -f elf64 -o $@ $<
build:
mkdir -p build
clean:
@bysse
bysse / README.md
Last active April 2, 2020 08:16
Utility for comparing COVID-19 cases side by side between countries.
@bysse
bysse / TestRig2.java
Created September 24, 2014 15:15
A version of ANTLR4 TestRig that support packages
/*
* [The "BSD license"]
* Copyright (c) 2012 Terence Parr
* Copyright (c) 2012 Sam Harwell
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
#!/usr/bin/python
import sys, getopt
import Image, ImageDraw
# This is the colors of the pearls used by the original software
colors = [
(0x17, 0x20, 0x29),(0x48, 0x3f, 0x38),
(0x57, 0x3b, 0x38),(0x80, 0x1f, 0x32),
(0xb3, 0x61, 0x2f),(0xa9, 0x90, 0x7c),
@bysse
bysse / ColumnFlowArrangement.java
Created September 19, 2013 17:53
A JFreeChart layout for both the vertical and the horizontal axis. It works by specifying the width, in items, of the initial column. The column is filled with as many labels as there is room for, then a new column will be created with the same width. The arrangement works the same way for rows. http://blog.slackers.se/2009/07/jfreechart-legend-…
package se.slackers.jfreechart;
import java.awt.Graphics2D;
import java.awt.geom.Rectangle2D;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.jfree.chart.block.Arrangement;
import org.jfree.chart.block.Block;
@bysse
bysse / cookie_watcher.js
Created September 11, 2013 07:48
Watching when the Golden Cookie is about to appear and alerts you! This will only work properly in Chrome, make sure to click on the version number to grant permission for HTML5 notifications otherwise it will only notify in the JS console.