Skip to content

Instantly share code, notes, and snippets.

View donn's full-sized avatar

Mohamed Gaber donn

View GitHub Profile
@donn
donn / Icarus Verilog Tutorial.md
Last active October 19, 2022 18:45
Icarus Verilog Tutorial
@donn
donn / Futures.md
Last active June 10, 2019 08:19
No frills swift future

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 March 21, 2019 16:48
C++ Reflection Test Thing
// 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 March 18, 2019 08:23
Social media Fetch Thing

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 June 26, 2018 17:40
Terminal.app Solarized Light Theme
<?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 18:02
My MacBook's autohotkey setup
; 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
/* vim: syntax=swift */
/*
TruthTable.plaground
A truth table generator with a syntax as ugly as sin.
Swift
--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
#!/usr/bin/env python3
# Calculator
# Product of a Python Lex-Yacc tutorial.
# Python 3
# --
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
@donn
donn / GPA.playground
Last active December 2, 2017 12:14
GPA projection Swift playground thing
/* vim: syntax=swift */
/*
GPA Calculator
...I got tired of having to re-enter my GPA in AIS's JavaScript mess, so there you have it.
Swift
--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
@donn
donn / NANDEquivalent.swift
Last active August 12, 2017 15:40
Turn any logic into unoptimized NAND-only logic.
/*
Illogical - NAND Equivalent
That was my first Swift program. You can tell, really.
I also wrote it before I knew tokenization was a thing, so the code's... nightmarish.
This is a simple program that takes a logical proposition
and outputs an (unoptimized) NAND equivalent. It was written
as a project for a discrete mathematics course.