Converts a file into a data URL.
e.g.
dataurl test.png
| // | |
| // When | |
| // | |
| // Allows for vertain validation rules to only apply under certain conditions, using only an Attribute. | |
| // e.g., if a certain string should match the regex `^.+@.+$` when another property, "WantsEmail", is equal to `true`: | |
| // | |
| // [When("WantsEmail", true, typeof(DoesRegexMatch), "^.+@.+$", Error = "Wants email, but none provided!"] | |
| // public string AProperty { get; set; } | |
| // |
| #!/usr/bin/env bash | |
| # boxit: Format text inside box-drawing sections. | |
| # Reads from stdin, waits for EOF (^D), then prints output to stdout. | |
| # Lines containing three dashes will be converted into separators! | |
| # Usage: boxit [--round] | |
| # Copyright 2019 Ethan McTague | |
| # License to use, modify, and distribute this software is granted to | |
| # any and all entities wherever permitted by law. |
| uini: header-only INI parser | |
| by Ethan McTague - November 8, 2019 | |
| Example: | |
| #include "uini.h" | |
| void handler(const char *section, const char *key, const char *value, void *user) { | |
| printf("%s::%s = %s\n", section, key, value); | |
| } |
| Animals that lay eggs don't have belly buttons. | |
| Beavers can hold their breath for 45 minutes under water. | |
| Slugs have four noses. | |
| Camels have three eyelids. | |
| A honey bee can fly at 15mph. | |
| A queen bee can lay 800-1,500 eggs per day. | |
| A bee has five eyelids. | |
| The average speed of a housefly is 4.5 mph. | |
| Mosquitoes are attracted to people who just ate bananas. | |
| Flamingos turn pink from eating shrimp. |
| /** Base case of OpenGL attrib pointer template tool. */ | |
| template<typename P, typename T> | |
| inline void attribPointers(int n = 0, size_t s = 0) { | |
| glEnableVertexAttribArray(n); | |
| glVertexAttribPointer(n, sizeof(T)/sizeof(float), GL_FLOAT, GL_FALSE, sizeof(P), (void*)s); | |
| } | |
| /** Applies all OpenGL attrib pointers given as type arguments (first argument is vertex class). */ | |
| template<typename P, typename T, typename S, typename ...Args> | |
| inline void attribPointers(int n = 0, size_t s = 0) { |
| # Distributed under the OSI-approved BSD 3-Clause License. | |
| # See https://cmake.org/licensing for details. | |
| #[=======================================================================[.rst: | |
| FindGLFW | |
| ------- | |
| Finds GLFW3. | |
| Imported Targets |
| #include "memo.h" | |
| #include <stdlib.h> | |
| int main (int argc, char** argv) | |
| { | |
| // We initialize our memo set | |
| memo_set* set = memo_set_new (); | |
| // We make a thing and add it to the memo set | |
| void* someData = malloc(20); |
| #!/bin/sh | |
| # The Lazy Init System for Lazy People | |
| # ------------------------------------ | |
| # by: Ethan McTague <[email protected]> | |
| # Copyright 2018 Ethan McTague | |
| # ------------------------------------ | |
| # | |
| # This is an init system that sets up | |
| # critical things, opens a login |
| /* brightness.c - Because xbacklight doesn't work for me. | |
| * Features: Cubic ease-in-out interpolation of brightness over time. | |
| * | |
| * Currently works with a single target device from /sys/class/backlight. | |
| * Previously only worked on intel_backlight, has since been adapted to search | |
| * for the proper controller. | |
| * | |
| * Ethan McTague <[email protected]> - January 28, 2018 | |
| * Public domain - free to use/modify without any restrictions. | |
| * |