Skip to content

Instantly share code, notes, and snippets.

View natbro's full-sized avatar

Nat Brown natbro

View GitHub Profile
@natbro
natbro / fixup-old-macos-sdks.sh
Created November 13, 2018 03:10
script to link older macOS SDKs into newer Xcode so you can target older platforms properly
#!/bin/bash
# ---------------------------------------------------------------------------------------------------------
# place as many old macOS SDKs into the directory with this script e.g. if you have
#
# my-macpro:SDKs natb$ ls -ahl
# total 4254792
# drwxr-xr-x 17 natb admin 578B Nov 21 2017 .
# drwxrwxr-x 24 root admin 884B Aug 29 06:46 ..
# drwxr-xr-x 5 natb admin 170B Oct 17 2017 MacOSX10.10.sdk
-(void)alertPulse {
// ios7+-style UIAlertView drop-and-bounce. if starting hidden, fade in from quite big & fade in until completion,
// otherwise pulse up then back with default ease-in/-out to look springy, no fading
BOOL wasHidden = NO;
if (self.hidden == YES) {
wasHidden = YES;
self.alpha = 0.0;
self.transform = CGAffineTransformMakeScale(1.5, 1.5);
}
self.hidden = NO;
@implementation UIView (Pulse)
- (void)pulseOnce
{
[self pulse:NO];
}
- (void)pulse:(BOOL)repeats
{
CGAffineTransform initialTransform = CGAffineTransformIdentity; // self.transform;
@natbro
natbro / broken-setTimeout.js
Created December 5, 2014 05:09
chained setTimeout failures in node.js
var iterations = 5;
var timeout;
var last = Date.now();
// --------------------
// version 1, this behaves pretty much as you'd expect - this loop takes 0-1ms and runs almost exactly ever 200ms
//
var loop1 = function() {
var start = Date.now();
// do nothing

Keybase proof

I hereby claim:

  • I am natbro on github.
  • I am natbro (https://keybase.io/natbro) on keybase.
  • I have a public key whose fingerprint is EA7A F4A1 D419 DF2D BD45 65E4 DA34 9C30 AFBF C51F

To claim this, I am signing this object:

Verifying that +natbro is my Bitcoin username. You can send me #bitcoin here: https://onename.io/natbro