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
#!/bin/python | |
import tkinter as tk | |
import subprocess as sp | |
import os | |
rot = ["normal", "left", "inverted", "right"] | |
trans = ["1 0 0 0 1 0 0 0 1", "0 -1 1 1 0 0 0 0 1", "-1 0 1 0 -1 1 0 0 1", "0 1 0 -1 0 1 0 0 1"] | |
devs = ["Wacom HID 5215 Finger touch", "Wacom HID 5215 Pen stylus", "Wacom HID 5215 Pen eraser"] |
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
typedef unsigned short u16; | |
u16 random_u16(void) { | |
static u16 s; | |
s ^= s << 8; | |
s = ((s & 0xFF) << 1) ^ ((s << 8) | (s >> 8)); | |
s = 38607*s + 35335; | |
s = (s >> 1) ^ (-(~s & 1) & 0x9E74) ^ 0x7E00; |
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
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d import Axes3D | |
#from matplotlib.animation import FuncAnimation | |
import numpy as np | |
import sys | |
rng = list(map(float, sys.stdin.readlines())) | |
period = len(rng) | |
#print(rng) |
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
#!/bin/env python3 | |
import sys, string | |
def str_findp(start, s, pred): | |
for i in range(start,len(s)): | |
if pred(s[i]): | |
return i | |
return None | |
#takes a list of lines as template for the ascii art; and a list of tokens (for example, words) to replace it with |
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
const std = @import("std"); | |
const assert = std.debug.assert; | |
const trait = std.meta.trait; | |
//example: | |
// BitReg(u32, .{ | |
// .{.first_4_bits, 0, 4}, | |
// .{.next_7_bits, 4, 7}, | |
// }) | |
pub fn BitReg(comptime T: type, comptime fields: anytype) type { | |
const check_or = struct { |
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
#!/bin/env python | |
import subprocess, json, re, shutil, os | |
srcurl = "https://ziglang.org/download/index.json" | |
tmppath = "/tmp/zig-master.tar.xz" | |
print(" > downloading index...") | |
src = subprocess.check_output(["curl", "-L", srcurl]) |
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
#!/bin/python | |
""" | |
usage: mmacrofmt.py [tabsize] < infile > outfile | |
formats something like: | |
#define X(a) \ | |
whatever \ | |
missing a backslash | |
//some comment | |
hmm\ |
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 <stdint.h> | |
#include <cstdio> | |
#include <iostream> | |
#include <cmath> | |
typedef struct fix32 { | |
int32_t n; | |
static const int32_t FACTOR = (1<<16); | |
//constructor |
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 <SDL2/SDL.h> | |
#include<math.h> | |
enum {FALSE ,TRUE}; | |
enum {W=600,H=400}; | |
int _SCROLLX = 0; | |
int _SCROLLY = 0; | |
SDL_Surface* screen; |
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
#!/bin/python | |
import sys, os, subprocess, re | |
if len(sys.argv) < 2: | |
print("""\ | |
usage: neocpkg <command> [neocities website name | website/pkg] | |
commands: | |
init\t create a repo here |
NewerOlder