Skip to content

Instantly share code, notes, and snippets.

@Screwtapello
Screwtapello / path.rs
Last active June 15, 2018 04:01
Monotonic path implementation for Rust
//! Cleaned-up cross-platform path handling
//!
//! Most operating systems accept a complex syntax for specifying filesystem
//! paths, including special notation for things like "the current directory"
//! and "the parent directory" that make path-handling code intricate. If
//! filesystem paths always described a straight-line path from the root to
//! the file or directory in question, path-handling code could be much simpler.
//!
//! This module contains types representing exactly those kinds of paths.
//!
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
aaabaaabaaa
! /* <-- A hack to stop xrdb from reading this file
# Behaviour changes
XTerm*saveLines: 10000
XTerm*scrollTtyOutput: false
XTerm*scrollKey: true
XTerm*scrollBar: false
XTerm*metaSendsEscape: true
XTerm*VT100.Translations: #override \
@Screwtapello
Screwtapello / Firebrand-X-NES-Saturated.gpl
Created January 1, 2016 03:15
FirebrandX's Final NES Composite Palette
GIMP Palette
Name: FirebrandX NES Saturated
Columns: 4
#
255 255 255 White 1
255 255 255 White 2
178 178 178 White 3
107 107 107 White 4
187 227 254 Blue 1
83 172 253 Blue 2
#!/usr/bin/python
import sys
import os
import re
from xml.etree import ElementTree as ET
SAVE_TYPE_RE = re.compile(r"""
EEPROM_V\d{3} |
SRAM_V\d{3} |
SRAM_F_V\d{3} |
@Screwtapello
Screwtapello / termcolors.sh
Created March 26, 2012 04:04
Which are the bright terminal colours?
#!/bin/bash
get_color_from_palette() {
# Query the terminal for the current value of a palette entry.
# Prints three decimal numbers from 0-65535 representing the red, green and
# blue components of the given palette entry.
local paletteNum="$1"
# This function only works in xterm and (some) derivatives
if [ "${TERM:0:5}" != "xterm" ]; then