Skip to content

Instantly share code, notes, and snippets.

The6P4C The6P4C

View GitHub Profile

Keybase proof

I hereby claim:

  • I am The6P4C on github.
  • I am the6p4c ( on keybase.
  • I have a public key whose fingerprint is 9231 C26F 30D2 C300 2C10 BDB7 56DA 106A A090 A846

To claim this, I am signing this object:

View gist:40060055467f1539e741
import os, sys
import Image, ImageGrab, ImageOps
import time, random
from random import randrange
import win32api, win32con
from numpy import *
#Day 1 Goal: 800Yen - Bot Score: 1440Yen
View ohgod.js
The6P4C /
Last active Jan 10, 2017
Graph generator for looking at functions as mentioned in standupmaths' "Four has Four Letters"
def create_graph(classification_function, values, highlight_fixed_points=True):
connections = {}
for n in values:
if n not in connections.keys():
connections[n] = classification_function(n)
fixed_points = [item[0] for item in connections.items() if item[0] == item[1]]
fixed_point_styles = ['\t{0} [style=filled, fillcolor=red, fontcolor=white, fontsize=30];'.format(fixed_point) for fixed_point in fixed_points if highlight_fixed_points]
relationships = ['\t{0} -> {1}'.format(item[0], item[1]) for item in connections.items()]
class Sandpile:
def __init__(self, size, data=None):
self.size = size
if data:
assert(isinstance(data, list))
assert(len(data) == size)
for row in data:
assert(isinstance(row, list))
def generate_stacks(n):
if n == 1:
yield (True,)
yield (False,)
for stack in generate_stacks(n - 1):
yield stack + (True,)
yield stack + (False,)
def stack_flip(stack, n):
View gist:041771809b4fae1f0ac4945d8d24ef6d
LAI x (01XX)
load accumulator immediate
acc = x
LAM x (02XX)
load accumulator memory
acc = mem[x]
LAI x (0300)
load accumulator memory indirect
acc = mem[mem[0]]
SAM x (04XX)
from nmigen import *
from nmigen.cli import main
class Test:
def __init__(self):
self.out = Signal(8)
def get_fragment(self, platform):
data = list(range(10))
arr = Array(data)
View linker.ld
/* !heavily! work in progress */
ram (rwx) : org = 0x00000000, l = 64K
user (rx) : org = 0xFFF80000, l = 512K
.text : {
View bug.c
// Build with gcc -o bug bug.c
// Prints non-NULL address of y when executed outside of valgrind, and a NULL
// (rendered as "(nil)" by printf) when executed inside valgrind.
#include <stdio.h>
#include <stdlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <sys/types.h>
You can’t perform that action at this time.