Skip to content

Instantly share code, notes, and snippets.

View stevemoser's full-sized avatar
🐫
🥶

Steve Moser stevemoser

🐫
🥶
View GitHub Profile
@stevemoser
stevemoser / ota.c
Created November 2, 2020 02:07 — forked from KhaosT/ota.c
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <ctype.h>
#include <unistd.h>
#define _GNU_SOURCE 1
#include <string.h>
#include <sys/stat.h> // for mkdir
#include <sys/mman.h> // for mmap
@stevemoser
stevemoser / iOS 7 dynamic font mappings
Last active August 29, 2015 14:27 — forked from nuthatch/iOS 7 dynamic font mappings
What is UIFontTextStyleHeadline *really*? Dump out preferredFontForTextStyle for UIFontTextStyleHeadline, UIFontTextStyleSubheadline, UIFontTextStyleBody, UIFontTextStyleFootnote, UIFontTextStyleCaption1, UIFontTextStyleCaption2 to examine the font name, weight, and point size.
+ (void)describePreferredFonts
{
static NSArray *textStyles;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
textStyles = @[UIFontTextStyleHeadline,
UIFontTextStyleSubheadline,
UIFontTextStyleBody,
UIFontTextStyleFootnote,
UIFontTextStyleCaption1,
@stevemoser
stevemoser / Trees.swift
Last active August 29, 2015 14:25 — forked from CodaFi/Trees.swift
A small propositional logic proof tree generator and prover.
//: Playground - noun: a place where people can play
//: Prop 'til you Drop
indirect enum Formula : CustomStringConvertible {
case Var(String)
case Or(Formula, Formula)
case And(Formula, Formula)
case Imply(Formula, Formula)
case BiImply(Formula, Formula)
case Negate(Formula)