Skip to content

Instantly share code, notes, and snippets.

@khardix
khardix / games.zsh
Last active December 1, 2015 10:57
Existing game launcher script overview script
#!/bin/zsh
# Scan this directory for game launchers and present window to pick from them.
# Dependencies: awk zenity
# Game launcher format:
# Game launcher is executable text file (i.e. shell script), which contains
# one or more lines describing the game being launched. The basic format is:
#
# #GAME: Game title
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
ROMAN_NUMBERS = {
1000: 'M', 900: 'CM', 500: 'D', 400: 'CD',
100: 'C', 90: 'XC', 50: 'L', 40: 'XL',
10: 'X', 9: 'IX', 5: 'V', 4: 'IV',
1: 'I'
}
@khardix
khardix / tree.cc
Created June 14, 2015 09:27
Storage tree with multiple possible views
#include <memory>
#include <list>
#include <string>
#include <stdexcept>
#include <iostream>
class Node : public std::enable_shared_from_this<Node>
{
private:
const Node *m_parent; ///< Read-only reference to parent node, modified only on node insert or release