Skip to content

Instantly share code, notes, and snippets.

View eddieh's full-sized avatar
🎮
Creating a driver

Eddie Hillenbrand eddieh

🎮
Creating a driver
View GitHub Profile
@eddieh
eddieh / console-style.js
Created March 21, 2021 20:02
Stylize console.log
console.log('%cYo!', 'font-family: cursive; font-size: 3em; color: indigo')
@eddieh
eddieh / mono.js
Created March 21, 2021 19:56
Turn an ASCII string into a Mathematical Monospaced String in JS
function mono(str) {
const ASCII_A = 'A'.codePointAt(0)
const ASCII_Z = 'Z'.codePointAt(0)
const ASCII_a = 'a'.codePointAt(0)
const ASCII_z = 'z'.codePointAt(0)
const ASCII_0 = '0'.codePointAt(0)
const ASCII_9 = '9'.codePointAt(0)
const MONO_Alpha_offset = '𝙰'.codePointAt(0) - ASCII_A
const MONO_alpha_offset = '𝚊'.codePointAt(0) - ASCII_a
const MONO_num_offset = '𝟶'.codePointAt(0) - ASCII_0
@eddieh
eddieh / lnemacs
Created March 17, 2021 18:36
make an alias in /Applications to emacs-mac from Homebrew
#!/bin/sh
#SRC=${1}
#DST=${2}
SRC="/usr/local/opt/emacs-mac/Emacs.app"
DST="/Applications"
osascript <<EOF
tell app "Finder"
@eddieh
eddieh / write-oldstyle-plist.m
Created March 4, 2021 17:42
Write Old-Style ASCII Property Lists like a Boss
#import <Foundation/Foundation.h>
#define BEGIN_AUTORELEASEPOOL @autoreleasepool {
#define END_AUTORELEASEPOOL }
int main(int argc, const char **arg)
{
BEGIN_AUTORELEASEPOOL
NSError *err;
@eddieh
eddieh / gist:56fbf306587482a429f0f1fa185c8945
Created December 30, 2020 16:32
GitHub's Homebrew request
$ brew update
Error:
homebrew-core is a shallow clone.
homebrew-cask is a shallow clone.
To `brew update`, first run:
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
@eddieh
eddieh / simple.m
Created June 8, 2020 15:31
Simplest possible single-file Cocoa app with dock icon and menu
#import <Cocoa/Cocoa.h>
int main(int argc, char **argv)
{
NSRect rect;
NSWindowStyleMask style;
NSAutoreleasePool *pool;
NSApplication *app;
NSMenu *menubar, *appMenu;
NSMenuItem *appMenuItem, *quitMenuItem;
@eddieh
eddieh / .msmtprc
Created February 29, 2020 18:38
msmtp configuration for iCloud email account
# -*- mode: conf; tab-width: 4; -*-
defaults
port 587
tls on
account primary
host smtp.mail.me.com
auth on
from account@icloud.com
@eddieh
eddieh / .mbsyncrc
Last active December 9, 2024 14:08
mbsync (isync) configuration for iCloud email account
# -*- mode: conf; tab-width: 4; -*-
## Passwords
# When using iCloud it is best to create an app-specific password
#
# https://support.apple.com/en-us/HT204397
#
# Store application specific passwords on macOS with

Build Your Own Windows Vagrant Box

Intro

I have found myself needing to test on Windows frequently. I need to be able to spin up fresh virtual machines—Vagrant seems to be the perfect solution.

I primarily use Macs for development and am currently using a cross compiler to develop native Win32 apps (and eventually Win64 apps). On the Mac side, basics like Homebrew are assumed to be

@eddieh
eddieh / .profile
Last active December 11, 2019 23:03
Colorize ls output and display a special symbol indicating the file type
## Colors
## The color designators are as follows:
# a black
# b red
# c green
# d brown
# e blue
# f magenta
# g cyan
# h light grey