Skip to content

Instantly share code, notes, and snippets.

View donn's full-sized avatar

Mohamed Gaber donn

View GitHub Profile
@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 / @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 / 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 / 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 / Icarus Verilog Tutorial.md
Last active October 19, 2022 18:45
Icarus Verilog Tutorial
@donn
donn / ALU.scala
Created October 12, 2019 12:13
RiscBEE ALU in Chisel
/*
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 / tm4c_mac_setup.rb
Last active October 28, 2019 22:43
TM4C123GH6PM Environment Mac Setup
#!/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 / cthreadpoolfuture.swift
Created November 17, 2019 15:08
c thread pool future 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 / iPhone Region Codes.md
Last active April 18, 2024 11:06
iPhone Region/Country Codes

iPhone Country Codes

Why I made this

The model regions on Apple wikis are missing some entries- and the entries are lacking some information that I would be critical for international buyers: there are some extreme differences between features in some regions: FaceTime support, Dual SIM support, etc.

What's worse is some regions have multiple codes, and sometimes even imported devices from other regions.

Unfortunately, Apple does not seem to acknowledge these region numbers exist and all and resort to nebulous claims about the feature differences, and it doesnt help that there are some conflicting reports on the internet.

So I'm going to try my best to maintain an up-to-date list. Any and all confirmations, additions and denials here would be extremely helpful. Please just leave a comment.

@donn
donn / graph.swift
Last active November 2, 2021 14:20
Swift Uniform Cost Search
#!/usr/bin/env quips
/*
Requires quips - github.com/donn/quips
yeet
Swift
--
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or