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 / smartBannerTest.js
Created August 28, 2013 13:09
Quickly test your app's smart banner using node.js and this snippet!
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">');
res.end('Check this out with your iDevice');
}).listen(1337, '0.0.0.0');
console.log('Server running at http://<thisMachine>:1337/');
@ethereal-engineer
ethereal-engineer / fuckingblocksyntax.html
Created September 2, 2013 00:15
Forked fuckingblocksyntax.com optimised for landscape PDF output
<html>
<head>
<title>How Do I Declare A Block in Objective-C?</title>
<style>
body {
background-color: #FFFFFF;
color: #83948F;
font-family: Lucida Grande, sans-serif;
font-size: 16px;
padding: 20px;
@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)
{
@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 / 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:" ]
// 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 {

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:

@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);
-- 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 / 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:% %