Skip to content

Instantly share code, notes, and snippets.

View ethereal-engineer's full-sized avatar
💭
Not painted, nor to scale

Doc ethereal-engineer

💭
Not painted, nor to scale
View GitHub Profile
@ethereal-engineer
ethereal-engineer / Observe ground.swift
Created December 19, 2015 02:17
WIP Observer Pattern Mental Workthrough
//: Observeground - noun: a place where things can watch
import UIKit
var str = "Hello, observers"
/// Generic protocol
protocol Observable {
typealias ObserverType
Take your shirt off Craig.You can leave your hat onCocoaHeads represent!!! 🍻Hi🍻🍻🍻🍻Fire base. Makes sense.You're all so handsome🍰🍰🍰Boo🚀Foghorns to be the first half of the year of high quality A stranger is someone you just haven't met yet 🐙The fact I can get it right away with the new version is better to be the first half of the year Nice squid I have to do with my friends to play the game with a few new update is a very good for the rest of your life to the next day or two Why have you disabled What is VIPER anyway?Where's the toilet?SupYou have the headset on wrongWhy is paste disabled????Craig loves me so much....No lemon party Craig Www.lemonparty.orgAll of me...Inside and out! 😉What color am iWho's Craig Chew with your mouth shut dammit🍉This is a cool fun thing One guess who craig is Though this shit was annoumous Balls!Mu ha ha NoI'm at the same thing to be in my room for a long way toward an amazing and so is my favourite songs How much equity?Sweat equity?Sweet sweet equittSweet kit Unique, capable,
@ethereal-engineer
ethereal-engineer / gist:e008ff1819d1c0c9f465
Created February 7, 2015 08:01
Track people you follow on Twitter on Keybase using t
echo "Note that this will only work for people who snag the same keybase handle as their twitter handle"
echo "Also note that this will only track them if they have proved their identity on twitter, as the one you follow (so it's probably safe)"
echo "I'm working on a regex version that will catch the rest of them (with different handles)"
t followings | xargs -n1 -I % keybase track --batch -a twitter:% %
-- Out of interest: square wave (a first attempt)
baseSquareMultiplier = 4 / pi
squareWaveComponent f t k = sin (2 * pi * ((2 * k) - 1) * f * t) / ((2 * k) - 1)
functionSum :: (Num a) => (a -> a) -> [a] -> a
functionSum _ [] = 0
functionSum f (x:xs) = (f x) + (functionSum f xs)
@ethereal-engineer
ethereal-engineer / timeIntervalToHoursAndMinutes.m
Created August 15, 2014 08:30
Converting between NSTimeInterval to human-readable hours and minutes
#pragma mark - Common Routines
// I would prefer a standard ObjC way to do this but this is what's in place for now
static inline void timeIntervalToHoursAndMinutes(NSTimeInterval timeInterval, double *hours, double *mins)
{
double fullMinutes = trunc(timeInterval / 60.0);
if (hours)
{
*hours = trunc(fullMinutes / 60.0);

Keybase proof

I hereby claim:

  • I am iosengineer on github.
  • I am iosengineer (https://keybase.io/iosengineer) on keybase.
  • I have a public key whose fingerprint is C92F F660 181C 3ECC 8FB9 A815 1532 FB01 96F8 EDC6

To claim this, I am signing this object:

// Playground - noun: a place where people can play
import Cocoa
var str = "Hello, playground"
operator infix ~ {}
@infix func ~ <T>(lhs: AnyObject, T) -> Bool {
if let output = lhs as? T {
@ethereal-engineer
ethereal-engineer / GinoE.swift
Created June 9, 2014 09:38
A bit of swift optimising
// Playground - noun: a place where people can play
import UIKit
var str = "Hello, playground"
var tableSourceArray = [
[
"Name" : "Provider",
"Details" : [ "Chosen Provider:" ]
@ethereal-engineer
ethereal-engineer / downloadWWDC2014SD.sh
Last active August 29, 2015 14:02
Fixed script for downloading all WWDC 2014 session videos in SD
curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.[^\ ]*_sd_.*dl=1">SD' | sed -e 's/\?dl=1">SD//g' | xargs -n1 wget -N
@ethereal-engineer
ethereal-engineer / bareEnumeratorDemo.mm
Created October 11, 2013 05:26
An example of how enumerators can be used to separate the collection of objects from the processing code. It's worthwhile also noting that enumerators can be created to return objects in any desired order.
#import <Foundation/Foundation.h>
void enumerate(NSEnumerator *enumerator, NSString *name)
{
id obj = [enumerator nextObject];
NSLog(@"Enumerating using '%@'...", name);
while (obj)
{