Skip to content

Instantly share code, notes, and snippets.

💜
GitHub seems like the wrong place to put a status?

C Jones porglezomp

Block or report user

Report or block porglezomp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@porglezomp
porglezomp / homestuck.dot
Last active Mar 19, 2019
Homestuck shipping diagram
View homestuck.dot
// neato -Tpng homestuck.dot > homestuck.png
digraph Shipping {
rankdir=LR;
sep="0.5";
overlap=scalexy;
//splines=true;
layout=neato;
subgraph {
edge [dir=none];
Rose -> Kanaya [label=""];
View Tuesday.idr
import Data.Fin
%language TypeProviders
%dynamic "./time.so"
%default total
epoch_seconds : IO Int
epoch_seconds = foreign FFI_C "epoch_seconds" (IO Int)
getTime : IO (Provider Int)
@porglezomp
porglezomp / meta.lua
Created Feb 2, 2019
Metatable on Metatables
View meta.lua
local x = { value = 42 }
local index = {
__index = function(t, k)
print(k)
if k == "__add" then
return function(l, r)
return { value = l.value + r.value }
end
end
end
View 00-README.md

Goto

These scripts goto and label let you handle jumping around to directories that you want to get to frequently, without having to figure out the path relative to where you are currently. To create a location, go to the directory you care about, then type label <name>. After you've done that, you're able to type goto <name> at any time to jump directly to that location.

Installation

To install on fish, copy the fish scripts into the locations listed at the top of them. To install on bash/sh/etc., copy the goto-label.sh into the end of your .profile, .bash_profile, or whatever else you have your config code in.

@porglezomp
porglezomp / twitter-alt-to-title.js
Last active Feb 10, 2019
Copy the alt text in tweets into the title text, so that you can see it on hover.
View twitter-alt-to-title.js
// ==UserScript==
// @name Twitter Alt-Text to Title-Text
// @description Copy the alt attribute of twitter images into the title attribute, so that I can see the alt text on hover.
// @version 1
// @grant none
// @include https://twitter.com/*
// ==/UserScript==
const SELECTORS = `.tweet .AdaptiveMedia-photoContainer img
, .Gallery-media img
View coded.py
CODED = [
[12, 24, 15, 12, 3, 6, 24, 23, 2, 26, 22, 24, 6, 19, 21, 6, 4, 24, 1, 2, 10, 6, 24, 26, 22, 6, 2, 11, 24, 10, 13, 2, 9, 6, 4],
[4, 8, 15, 6, 19, 12, 18, 24, 2, 1, 1, 24, 16, 6, 24, 26, 22, 6, 24, 4, 22, 12, 0, 6, 24, 26, 22, 6, 18, 24, 23, 12, 13, 26, 24, 15, 6, 24, 26, 8, 24, 16, 6],
[16, 20, 26, 24, 2, 24, 19, 8, 13, 26, 24, 10, 13, 8, 23, 24, 22, 8, 23, 24, 15, 20, 25, 22, 24, 15, 8, 11, 6, 24, 26, 22, 6, 18, 1, 1, 24, 23, 12, 10, 6, 24, 12, 23, 12, 18, 24, 16, 6, 5, 8, 11, 6, 24, 26, 22, 6, 18, 11, 6, 24, 4, 12, 26, 2, 4, 5, 2, 6, 19],
[26, 22, 6, 18, 24, 22, 12, 9, 6, 24, 4, 1, 2, 25, 6, 19, 24, 12, 23, 12, 18, 24, 15, 18, 24, 5, 1, 6, 4, 22],
[4, 22, 8, 11, 13, 24, 8, 5, 24, 20, 13, 4, 2, 21, 22, 26, 1, 18, 24, 1, 2, 15, 16, 4, 24, 12, 13, 19, 24, 8, 11, 21, 12, 13, 4],
[15, 8, 11, 6, 24, 4, 26, 2, 26, 25, 22, 24, 12, 13, 19, 24, 4, 25, 12, 11, 24, 26, 22, 12, 13, 24, 22, 20, 15, 12, 13],
[2, 5, 24, 8, 13, 1, 18, 24, 15, 12, 11, 16, 1, 6],
[21, 11, 6, 23, 24, 16
@porglezomp
porglezomp / 00 add baseline
Created Dec 14, 2018
Eggman Scheme Bytecode Examples
View 00 add baseline
function (+ a b) entry=bb0
bb0:
v0 = lookup 'assert
v1 = typeof v0
v2 = Binop.SYM_EQ v1 'function
brn v2 non_function
v3 = arity v0
v4 = Binop.NUM_EQ v3 1
brn v4 wrong_arity
v5 = lookup 'number?
View about.md

An Allocator

This is a working memory allocator for C++! It was written as test code for an operating systems class project, we were implementing a virtual memroy system, and so I built an allocator on top of that. To work, it needs access to a vm_map call which will return a fresh 4KB page, and it needs to return consecutive addresses for consecutive calls (at least most of the time, or else we can't allocate large blocks).

It is based on a linear search through a free list, with a best-fit allocation scheme.

View SketchSystems.spec
# Memory Eviction
Start*
swap page -> NoRW
file page -> NoRW
NoRW
read -> Read
write -> ReadWrite
queue -> Start
@porglezomp
porglezomp / bowser.txt
Last active Oct 3, 2018
pictures of bowser and others
View bowser.txt
Bowser:
https://twitter.com/ayyk92/status/1042465252221181954
https://twitter.com/GurepyonArt/status/1044287471226441729
https://twitter.com/Matilda_Fiship/status/1044311156930818049
https://twitter.com/spacegarbage/status/1044332916929712133
https://twitter.com/Pan_Neji/status/1044212272346918912
https://twitter.com/barachan/status/1044326502228275200
https://twitter.com/iDoodlerz/status/1044302585790959616
https://twitter.com/ZA1F0N/status/1044268102005874689
https://twitter.com/lazymimium/status/1044001136636825601
You can’t perform that action at this time.