Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile
static vlong
promptline(char const *prompt, char *buf, vlong size);
#include "example-keys.h"
static int
mcrypt_server_handler(vlong s1, vlong)
{
int s2 = len32_start(s1);
if (s2 < 0)
#pragma omp parallel for
for (int j = 0; j < num_instances; j++) {
mat4 mmodel = GLM_MAT4_IDENTITY_INIT;
#if 1
int i_x = j % instances_width;
int i_y = j / instances_width;
int x = 7.0f * ((f32)i_x - (f32)instances_width / 2.0f);
int y = 7.0f * ((f32)i_y - (f32)instances_width / 2.0f);
x += 2.0f * (2.0f * timeoffset[j][3] - 1.0f);
y += 2.0f * (2.0f * timeoffset[j][4] - 1.0f);
mbsync_std_account() {
local IFS=$' \t\n'
local id=$1
local host=$2
local addr=$3
local user=$addr
local -a mailboxes=( "${@:4}" )
if [[ "$id" == "@" ]]; then
id="${3//[@\.]/-}"
@milesrout
milesrout / union.c
Last active August 22, 2020 05:34
Object system A or B?
enum object_type { INT, CSTR };
struct object {
int type;
union {
int intvalue;
const char *cstrvalue;
};
};
int
object_equal(struct object *l, struct object *r)
File "./beetle.py", line 157, in process_phases
return pipeline.execute()
File "./beetle.py", line 238, in execute
result = getattr(self, phase.lower())(result)
File "./beetle.py", line 259, in imports
ast = self.import_handler.process(ast, **kwds)
File "/home/miles/programming/beetle/importer.py", line 52, in process
return self.expand(ast)
File "/home/miles/programming/beetle/importer.py", line 74, in imexpand_ImportStatement
modules.append(self.handler.load_module(name.name, ast.pos))
r n . . k b n r
a . q . a a . a
B a . . . . . .
. . a . A . a .
. . A . . A . .
. . . . . . . .
A A . . . . A A
R N B Q K . N R
Choose a move: Bb5
template <typename, typename> struct is_less_than;
template <int X, int Y> struct is_less_than<Int<X>, Int<Y>> : std::bool_constant<(X < Y)> {};
template <typename A, typename B> static constexpr bool is_less_than_v = is_less_than<A, B>::value;
template <typename, typename, typename=void> struct do_merge;
template <typename As, typename Bs> using merge = typename do_merge<As, Bs>::type;
// Need this because specialisations are chosen by specificity and
// ties are broken not by order but by compiler error.
template <>
@milesrout
milesrout / list-focused-fftabs.py
Last active November 29, 2019 09:28 — forked from tmonjalo/list-fftabs.py
List currently focused Firefox tabs
#! /usr/bin/env python3
"""
List all Firefox tabs with title and URL
Supported input: json or jsonlz4 recovery files
Default output: title (URL)
Output format can be specified as argument
"""
@milesrout
milesrout / better.c
Created November 21, 2019 04:12
my opinion
struct wlr_surface *wlr_surface_surface_at(struct wlr_surface *surface,
double sx, double sy, double *sub_x, double *sub_y) {
// Do stuff
}
"""Investigating and implementing MCTS without the complications of the MTG simulator."""
from collections import Counter
from copy import deepcopy
import math
import random
import cProfile
compose = lambda f: lambda g: lambda *args, **kwds: f(g(*args, **kwds))