Skip to content

Instantly share code, notes, and snippets.

View prepare_gradebook.rb
#!/usr/bin/env ruby
# Prepare Blackboard Gradebook
#
# This turns a typical Blackboard assignment file download into something
# actually usable: The folders are arranged by student.
#
# It also generates a Gradebook .csv with the appropriate late penalty for
# all students.
#
# Ruby
@donn
donn / cthreadpoolfuture.swift
Created Nov 17, 2019
c thread pool future swift
View cthreadpoolfuture.swift
// attempted to replace GCD but it turns out GCD was not in fact broken so uh Linux
import Foundation
import CThreadPool
var pool: threadpool?
public class Future {
private var semaphore: DispatchSemaphore
private var store: Any?
private var executor: () -> Any
@donn
donn / tm4c_mac_setup.rb
Last active Oct 28, 2019
TM4C123GH6PM Environment Mac Setup
View tm4c_mac_setup.rb
#!/usr/bin/env ruby
# TM4C123GH6PM Environment Mac Setup
#
# This is what I do when I procrastinate.
#
# I recommend you have homebrew pre-installed for this, but the script
# will try to install it anyway.
#
# (To get STM32 working on Mac instead, try
@donn
donn / ALU.scala
Created Oct 12, 2019
RiscBEE ALU in Chisel
View ALU.scala
/*
The RiscBEE ALU in Chisel
I rewrote the ALU for github.io/donn/RiscBEE in Chisel in the initial research phase for Phi…
I uh. Wasn't a fan.
Scala
--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
@donn
donn / Icarus Verilog Tutorial.md
Last active Sep 11, 2019
Icarus Verilog Tutorial
View Icarus Verilog Tutorial.md
@donn
donn / Futures.md
Last active Jun 10, 2019
No frills swift future
View Futures.md

Single-file no-frills Futures implementation for Swift

For when you aren't loading images.

import Foundation

public class Future<Type> {
    private var store: Type?

    private var mutex: pthread_mutex_t
@donn
donn / reflection.cpp
Created Mar 21, 2019
C++ Reflection Test Thing
View reflection.cpp
// Knowledge is power
// This is trivial, in the public domain, do whatever you want, no warranty, etc
// (I think this only works with GCC and Clang)
#include <typeinfo>
#include <iostream>
#include <cxxabi.h>
struct A {
virtual void print(std::ostream& stream) {
@donn
donn / @Readme.md
Created Mar 18, 2019
Social media Fetch Thing
View @Readme.md

Social Media Fetch Thing

I was somewhere where I had unlimited social media, so here's something that uses Heroku to send me anything via DM on Twitter

Run server.rb on Heroku, DM yourself "!smcurl your-url-here", wait a bit and use download.rb on your computer and it will save the fetched result to output.

In practice, not very practical because of tweet DM rate limits but eh I tried

License

This is free and unencumbered software released into the public domain.

@donn
donn / Solarized Light.terminal
Last active Jun 26, 2018
Terminal.app Solarized Light Theme
View Solarized Light.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!--
Solarized Light Terminal Theme
XML
--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
@donn
donn / Bootcamp.ahk
Created May 24, 2018
My MacBook's autohotkey setup
View Bootcamp.ahk
; Boot Camp AutoHotkey Bindings
;
; Removes some of the "Damn you, muscle memory" involved with Boot Camp
;
; AutoHotkey
; --
; This is free and unencumbered software released into the public domain.
; Anyone is free to copy, modify, publish, use, compile, sell, or
; distribute this software, either in source code form or as a compiled
; binary, for any purpose, commercial or non-commercial, and by any
You can’t perform that action at this time.