Skip to content

Instantly share code, notes, and snippets.

View aydenp's full-sized avatar

Ayden Panhuyzen aydenp

View GitHub Profile
@aydenp
aydenp / UIViewController+ShorthandAlerts.swift
Last active November 25, 2020 07:10
Creating alerts on iOS is annoying. This extension allows you to easily present alerts on view controllers. It also improves UIAlertAction by adding a quicker more Swift-like shorthand for making actions.
//
// UIViewController+ShorthandAlerts.swift
//
// Created by Ayden Panhuyzen on 2017-07-31.
// Copyright © 2017-2018 Ayden Panhuyzen. All rights reserved.
// https://gist.github.com/aydenp
//
import UIKit
@aydenp
aydenp / Randoms.swift
Last active March 21, 2018 01:43
Easy randoms in Swift
//
// Randoms.swift
//
// Created by Ayden Panhuyzen on 2018-03-17.
// Copyright © 2018 Ayden Panhuyzen. All rights reserved.
// https://gist.github.com/aydenp
//
import UIKit
@aydenp
aydenp / HairlineView.swift
Last active October 7, 2019 23:55
Create a view equal to exactly one real pixel in height, even on Retina and Retina HD displays.
//
// HairlineView.swift
//
// Created by Ayden Panhuyzen on 2018-04-02.
// Copyright © 2018 Ayden Panhuyzen. All rights reserved.
// https://gist.github.com/aydenp
//
import UIKit
@aydenp
aydenp / UIEdgeInsets+All.swift
Last active April 2, 2018 11:15
repeating code is bad
//
// UIEdgeInsets+All.swift
//
// Created by Ayden Panhuyzen on 2018-04-02.
// Copyright © 2018 Ayden Panhuyzen. All rights reserved.
// https://gist.github.com/aydenp
//
import UIKit
@aydenp
aydenp / InstagramFollowerComparer.js
Last active April 23, 2018 05:53
Figure out who doesn't follow back/who you don't follow back on Instagram with a short JavaScript snippet.
/*
InstagramFollowerComparer.js
Created by Ayden Panhuyzen on 2018-04-23.
Copyright © 2018 Ayden Panhuyzen. All rights reserved.
https://gist.github.com/aydenp
Figure out who doesn't follow back/who you don't follow back on Instagram via a JavaScript script.
---
Steps:
@aydenp
aydenp / UIColor+RGBA.swift
Created April 23, 2018 15:21
Easily get RGB, HSL, white, and alpha information, whether a colour is light in Swift. Also can transition between two colours using the float you provide and tell you if a provided colour is lighter or darker.
//
// UIColor+RGBA.swift
//
// Created by Ayden Panhuyzen on 2018-04-10.
// Copyright © 2018 Ayden Panhuyzen. All rights reserved.
// https://gist.github.com/aydenp
//
import UIKit
@aydenp
aydenp / fun.js
Last active November 29, 2019 04:00
slowly descend into Cyrillic with some terrible code
const translit = require('latin-to-cyrillic')
const text = `According to all known laws of aviation, there is no way a bee should be able to fly. Its wings are too small to get its fat little body off the ground. The bee, of course, flies anyway because bees don't care what humans think is impossible. Yellow, black. Yellow, black. Yellow, black. Yellow, black. Ooh, black and yellow! Let's shake it up a little. Barry! Breakfast is ready! Ooming! Hang on a second. Hello? - Barry? - Adam? - Oan you believe this is happening? - I can't. I'll pick you up. Looking sharp. Use the stairs. Your father paid good money for those. Sorry. I'm excited. Here's the graduate. We're very proud of you, son. A perfect report card, all B's. Very proud. Ma! I got a thing going here. - You got lint on your fuzz. - Ow! That's me! - Wave to us! We'll be in row 118,000. - Bye! Barry, I told you, stop flying in the house! - Hey, Adam. - Hey, Barry. - Is that fuzz gel? - A little. Special day, graduation. Never thought I'd make it. Th
@aydenp
aydenp / remove-twitter-photos.js
Created December 2, 2019 02:24
Remove profile photo and banner from twitter (since there's no longer a UI for removing profile photo)
const Twitter = require('twitter');
// fill in:
var client = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
access_token_secret: ''
});
@aydenp
aydenp / NSAssertionHandler+BeGone.m
Last active December 23, 2019 04:39
leave me alone!
//
// NSAssertionHandler+Goodbye.m
// please only ever use this for patching out apple checks, never in prod
//
// Created by Ayden Panhuyzen on 2019-12-20.
// Copyright © 2019 Ayden Panhuyzen. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <objc/runtime.h>
@aydenp
aydenp / UIBackgroundStyle-Test.entitlements
Last active September 19, 2021 21:46 — forked from AppleBetas/gist:4ddf91c8ead4b2a87a71bcd52eab258b
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.springboard.appbackgroundstyle</key>
<true/>
</dict>
</plist>