Skip to content

Instantly share code, notes, and snippets.

View PowerSnail's full-sized avatar

Power Snail PowerSnail

View GitHub Profile
@PowerSnail
PowerSnail / day16.rs
Created December 16, 2021 09:02
Day16
fn hex_to_binary(b: u8) -> String {
let n = match b {
b'0'..=b'9' => b - b'0',
b'A'..=b'F' => b - b'A' + 10,
_ => unreachable!(),
};
format!("{:04b}", n)
}
#[derive(Debug)]
@PowerSnail
PowerSnail / int_as_english.py
Created May 7, 2017 22:07
Integer to English
DIGITS = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine']
TEN2TWENTY = ['ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen']
TENS = ['', '', 'twenty', 'thirty', 'forty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety']
def as_english(n : int):
if n < 10:
return DIGITS[n]
if n < 20:
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 16,
// font family with optional fallbacks
fontFamily: 'Menlo, "DejaVu Sans Mono", Consolas, "Lucida Console", monospace',
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk)
cursorColor: 'rgba(0,200,0,0.8)',