Converts a file into a data URL.
e.g.
dataurl test.png
| // Simple Base64 encode/decode that works in node and the browser. | |
| var base64 = { | |
| encode: function (text) { | |
| if (typeof btoa === 'function') | |
| return btoa(text) | |
| else | |
| return new Buffer(text).toString('base64') | |
| }, | |
| decode: function (text) { | |
| if (typeof atob === 'function') |
| /* 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 <ethan@tague.me> - January 28, 2018 | |
| * Public domain - free to use/modify without any restrictions. | |
| * |
| #!/bin/sh | |
| # The Lazy Init System for Lazy People | |
| # ------------------------------------ | |
| # by: Ethan McTague <ethan@tague.me> | |
| # Copyright 2018 Ethan McTague | |
| # ------------------------------------ | |
| # | |
| # This is an init system that sets up | |
| # critical things, opens a login |
| #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); |
| # Distributed under the OSI-approved BSD 3-Clause License. | |
| # See https://cmake.org/licensing for details. | |
| #[=======================================================================[.rst: | |
| FindGLFW | |
| ------- | |
| Finds GLFW3. | |
| Imported Targets |
| /** 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) { |
| 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. |
| 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); | |
| } |
| #!/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. |