This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#\ | |
i\ | |
n\ | |
c\ | |
l\ | |
u\ | |
d\ | |
e\ | |
<\ | |
s\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <linux/module.h> | |
#include <linux/moduleparam.h> | |
#include <linux/init.h> | |
#include <linux/kernel.h> | |
#include <linux/fs.h> | |
MODULE_LICENSE("GPL"); | |
MODULE_AUTHOR("qookie"); | |
static int device_open(struct inode *, struct file *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bits 16 | |
org 0x7C00 | |
font_seg equ 0x1000 ; font at 0x1000:0x0000 | |
jmp 0x0:.start | |
.start: | |
cli | |
cld | |
xor ax,ax |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cassert> | |
#include <ctime> | |
#include <vector> | |
#include <termios.h> | |
#include <cstdio> | |
#include <utility> | |
#include <algorithm> | |
// helpers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <sstream> | |
#include <iterator> | |
constexpr const char *text_color_reset = "\e[0m"; | |
constexpr const char *text_color_red = "\e[31m"; | |
template<typename T> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; to use, compile your elf binary to run, and update BINARY_SIZE accordingly, | |
; then compile this file with `nasm -fbin elf_ldr.asm -o elf_ldr.bin` | |
; and concatenate the elf_ldr.bin and your elf file with `cat elf_ldr.bin <your.elf> >image` | |
bits 16 | |
org 0x7C00 | |
BINARY_SIZE equ 20 ; in sectors | |
entry: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <queue> | |
#include <utility> | |
#include <tuple> | |
#include <algorithm> | |
#include <type_traits> | |
namespace async { | |
template <typename AwaitFn, typename... AwaitArgs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename Cont> | |
struct enumeration { | |
enumeration(Cont &c) | |
:_c{c}, _begin{c.begin(), 0}, _end{c.end(), c.size()} | |
{} | |
private: | |
struct enumeration_iterator { | |
typename Cont::iterator it; | |
typename Cont::size_type n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sf::Keyboard::Key translate_key_name(const std::string &name) { | |
if (name == "a") return sf::Keyboard::A; | |
if (name == "b") return sf::Keyboard::B; | |
if (name == "c") return sf::Keyboard::C; | |
if (name == "d") return sf::Keyboard::D; | |
if (name == "e") return sf::Keyboard::E; | |
if (name == "f") return sf::Keyboard::F; | |
if (name == "g") return sf::Keyboard::G; | |
if (name == "h") return sf::Keyboard::H; | |
if (name == "i") return sf::Keyboard::I; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <epoxy/gl.h> // replace with proper include | |
void gl_debug_callback(GLenum source, GLenum type, GLuint id, | |
GLenum severity, GLsizei length, | |
const char *message, const void *) { | |
const char *sev = ""; | |
switch (severity) { | |
case GL_DEBUG_SEVERITY_HIGH: sev = "\e[91m"; break; | |
case GL_DEBUG_SEVERITY_MEDIUM: sev = "\e[93m"; break; |
OlderNewer