Skip to content

Instantly share code, notes, and snippets.

View djg's full-sized avatar
💭
I may be slow to respond.

Dan Glastonbury djg

💭
I may be slow to respond.
View GitHub Profile
@djg
djg / gist:b29eb5b7bb124292ec2b87a5319cd01f
Created April 22, 2022 01:21
Why is everything so slow?
Refreshing buffer ‘magit: OpenSource’...
magit-insert-error-header 2e-06
magit-insert-diff-filter-header 0.03445 !!
magit-insert-head-branch-header 0.045016 !!
magit-insert-upstream-branch-header 0.042379 !!
magit-insert-push-branch-header 3.2e-05
magit-insert-tags-header 2.7329790000000003 !!
magit-insert-status-headers 2.880756 !!
magit-insert-merge-log 0.019903 !
magit-insert-rebase-sequence 9.6e-05
@djg
djg / audio2.asm
Created January 28, 2022 01:11
Gyruss 8039 ROM
;;; ----------------------------------------------------------------------------
;;;
;;; gyrussk.3a - Gyruss 8039 sound cpu2 rom
;;;
;;; If you ever wondered how the percussion samples are generated in the arcade
;;; version of Gyruss.
;;;
;;; Builds with SB-Cross Assembler 3.
;;;
;;; % sbasm audio2.asm
@djg
djg / conway.sv
Created August 21, 2021 06:00
Game of life
module top_module(
input clk,
input load,
input [255:0] data,
output [255:0] q);
function bit[3:0] inc(input int x);
return x + 1;
endfunction
@djg
djg / five-games.txt
Last active July 12, 2021 12:06
Five formative games
# Five formative games
Space Invaders (Atari 2600)
---------------------------
The game and system that got me interested in computers. My father's best friend had an Atari 2600 system and I was
about 5 or 6 years old. I don't remember exactly when, but it was approx. '80-'81.
The Bard's Tale (Apple ][)
--------------------------
@djg
djg / test.rs
Created August 21, 2020 00:52
An Abomination Unto Nuggan
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#![allow(non_snake_case)]
use std::{
cell::UnsafeCell,
sync::atomic::{AtomicUsize, Ordering::SeqCst},
};
0:02.19 INFO Checking for ssltunnel processes...
0:02.22 INFO Checking for xpcshell processes...
0:02.25 SUITE_START: mochitest-plain - running 1 tests
0:02.25 INFO Running manifest: dom/tests/mochitest/general/mochitest.ini
pk12util: PKCS12 IMPORT SUCCESSFUL
0:02.54 INFO MochitestServer : launching [u'/home/djg/Mozilla/obj-ff-dbg.noindex/dist/bin/xpcshell', '-g', u'/home/djg/Mozilla/obj-ff-dbg.noindex/dist/bin', '-f', u'/home/djg/Mozilla/obj-ff-dbg.noindex/dist/bin/components/httpd.js', '-e', "const _PROFILE_PATH = '/tmp/tmpgIcAQ6.mozrunner'; const _SERVER_PORT = '8888'; const _SERVER_ADDR = '127.0.0.1'; const _TEST_PREFIX = undefined; const _DISPLAY_RESULTS = true;", '-f', '/home/djg/Mozilla/obj-ff-dbg.noindex/_tests/testing/mochitest/server.js']
0:02.54 INFO runtests.py | Server pid: 1441114
0:02.56 INFO runtests.py | Websocket server pid: 1441117
0:02.58 INFO runtests.py | SSL tunnel pid: 1441120
0:02.94 INFO runtests.py | Running with scheme: http
<html>
<head>
<style>
table {
display: inline-grid;
grid: auto / repeat(32, 1fr);
width: 100%;
border-collapse: collapse;
font-family: "Arial";
font-style: normal;
@djg
djg / task_system.cpp
Created March 3, 2020 03:34
Sean Parent - OKish Task System with Task Stealing in C++14
/* Horrible task system - task stealing */
#include <atomic>
#include <condition_variable>
#include <deque>
#include <functional>
#include <mutex>
#include <thread>
#include <vector>
using namespace std;
@djg
djg / task_system.cpp
Created March 3, 2020 03:16
Sean Parent Horribly Performing Task System - Queue per Thread
/* Horrible task system - queue per thread */
#include <atomic>
#include <condition_variable>
#include <deque>
#include <functional>
#include <mutex>
#include <thread>
#include <vector>
using namespace std;
@djg
djg / task_system.cpp
Created March 3, 2020 03:09
Sean Parent Horribly Performing Task System in C++14
/* Horrible task system */
#include <condition_variable>
#include <deque>
#include <functional>
#include <mutex>
#include <thread>
#include <vector>
using namespace std;