Skip to content

Instantly share code, notes, and snippets.

Taylor C. Richberger Taywee

Block or report user

Report or block Taywee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Taywee
Taywee / rogers.py
Created Aug 27, 2019
Convert hexadecimal numbers to the S. R. Rogers pronunciation system (MIT License)
View rogers.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2019 Taylor C. Richberger
# This code is released under the MIT license
import argparse
base = {
'0': 'zero',
'1': 'one',
@Taywee
Taywee / alltoz64.py
Created Feb 20, 2019
Simple python converter to change an input n64 rom to z64 format from any other byte order format
View alltoz64.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2019 Taylor C. Richberger <taywee@gmx.com>
# This code is released under the MIT license
import argparse
import shutil
from io import BytesIO
def convertchunk(chunk, byteswapped, wordswapped):
@Taywee
Taywee / dp370e.rs
Created Dec 19, 2018
Daily Programmer 370 Easy first shot solution.
View dp370e.rs
// Given a slice of upc digits, return the checksum
fn upc_raw(input: &[u8]) -> u8 {
let mut code = Vec::from(input);
while code.len() < 11 {
code.insert(0, 0);
}
if code.len() > 11 {
code.resize(11, 0);
}
@Taywee
Taywee / kh.js
Last active Dec 4, 2018
kathack https
View kh.js
/*
Copyright Alex Leone, David Nufer, David Truong, 2011-03-11. kathack.com
javascript:var i,s,ss=['http://kathack.com/js/kh.js','http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js'];for(i=0;i!=ss.length;i++){s=document.createElement('script');s.src=ss[i];document.body.appendChild(s);}void(0);
*/
var BORDER_STYLE = "1px solid #bbb",
CSS_TRANSFORM = null,
CSS_TRANSFORM_ORIGIN = null,
POSSIBLE_TRANSFORM_PREFIXES = ['-webkit-', '-moz-', '-o-', '-ms-', ''],
@Taywee
Taywee / dirfs.cxx
Created Oct 29, 2018
Simple sloppy directory-based sqlite VFS. MIT License
View dirfs.cxx
/* Copyright © 2018 Taylor C. Richberger <taywee@gmx.com>
* This code is released under the MIT license
*/
#include <memory>
#include <iostream>
#include <iterator>
#include <sstream>
#include <fstream>
#include <vector>
@Taywee
Taywee / encounters.py
Created Aug 18, 2018
Simple MIT-licensed Dungeons and Dragons encounter calculator written in python
View encounters.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright © 2018 Taylor C. Richberger <taywee@gmx.com>
# This code is released under the MIT license
import locale
import argparse
from collections import namedtuple
Threshold = namedtuple('Threshold', ['easy', 'medium', 'hard', 'deadly'])
@Taywee
Taywee / zipfs.cxx
Last active Jul 7, 2018
Simple sloppy attempt at making a compressed, optionally-encrypted vfs for sqlite using libzip (MIT License)
View zipfs.cxx
/* Copyright © 2018 Taylor C. Richberger <taywee@gmx.com>
* This code is released under the MIT License
*/
#include <memory>
#include <iostream>
#include <iterator>
#include <sstream>
#include <fstream>
#include <vector>
@Taywee
Taywee / enumerator.rb
Last active Feb 19, 2018
Ruby enumerator/enumerable implementations, minus lazy
View enumerator.rb
# FOR TESTING, REMOVE FOR ACTUAL USE
Object.send(:remove_const, :Enumerator)
Object.send(:remove_const, :Enumerable)
module Enumerable
# Used for undefined arguments, because "nil" can be significant.
UNDEFINED = BasicObject.new
def all?
return all? {|obj| obj} unless block_given?
@Taywee
Taywee / 348h.rs
Created Feb 4, 2018
Implementation of daily programming challenge 348 Hard. Reimplementation of existing algorithm, but in Rust.
View 348h.rs
use std::env;
#[derive(Debug, Clone, Copy)]
struct Pair(u32, u32);
impl Pair {
fn contains(&self, item: u32) -> bool {
self.0 == item || self.1 == item
}
// Get the item that isn't the one passed in
@Taywee
Taywee / 348h.rb
Last active Jan 28, 2018
Implementation of daily programming challenge 348 Hard. Not a useable solution, because it fails to complete the challenge in an appropriate time
View 348h.rb
#!/usr/bin/env ruby
# Copyright © 2018 Taylor C. Richberger <taywee@gmx.com>
# This code is released under the MIT license
require 'set'
def square?(number)
Math.sqrt(number).round ** 2 == number
end
You can’t perform that action at this time.