Skip to content

Instantly share code, notes, and snippets.

View alanzeino's full-sized avatar
🐱
cat

Alan Zeino alanzeino

🐱
cat
View GitHub Profile
@alanzeino
alanzeino / gist:1513216
Created December 23, 2011 05:14
Zoom and Fade effect on UIView
// where 'syncLabel' is a UILabel
[UIView animateWithDuration:0.2
delay:0.0
options:0
animations:^{
self.syncLabel.alpha = 0.2;
self.syncLabel.transform = CGAffineTransformMakeScale(3.0,3.0);
}
completion:^(BOOL finished) {
self.syncLabel.alpha = 1.0;
@alanzeino
alanzeino / NSArray+YOLO.m
Created March 19, 2013 01:17
firstObject category for NSArray
@implementation NSArray (YOLO)
- (id)firstObject
{
if (self.count)
return [self objectAtIndex:0];
return nil;
}
@end
@alanzeino
alanzeino / Strong UINavigationBar colour
Last active April 26, 2020 23:34
Combining a strong colour with a blurred and translucent UINavigationBar in iOS 7.
// cheers to @stroughtonsmith for helping out with this one
UIColor *barColour = [UIColor colorWithRed:0.13f green:0.14f blue:0.15f alpha:1.00f];
UIView *colourView = [[UIView alloc] initWithFrame:CGRectMake(0.f, -20.f, 320.f, 64.f)];
colourView.opaque = NO;
colourView.alpha = .7f;
colourView.backgroundColor = barColour;
self.navigationBar.barTintColor = barColour;
@alanzeino
alanzeino / lldb-debugging.md
Last active December 13, 2024 16:27
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.

#!/usr/bin/env ruby
require 'yaml'
def find_value_for_key(yaml_file, key)
yaml_file.each do |yaml_key, yaml_value|
if key == yaml_key
return yaml_value
end
end
#!/usr/bin/env ruby
require 'yaml'
def find_value_for_key(yaml_file, key)
yaml_file.each do |yaml_key, yaml_value|
if key == yaml_key
return yaml_value
end
end
@alanzeino
alanzeino / LinkedList.swift
Created October 7, 2016 18:42
A simple LinkedList in Swift 3 using Sequence and IteratorProtocol
//: Playground - noun: a place where people can play
import Foundation
class Node {
let value: Any
var next: Node?
init(value: Any, next: Node?) {
@alanzeino
alanzeino / NavigationController.swift
Created January 8, 2017 00:12
Replacing a UINavigationController's default animation transition with a custom transition
//
// NavigationController.swift
//
import UIKit
class NavigationController: UINavigationController {
init() {
super.init(nibName: nil, bundle: nil)
#!/usr/bin/swift
// Run: $ swift noCrashplan.swift
// Background: https://github.com/KrauseFx/overkill/issues/3#issuecomment-270505227
import Foundation
import Cocoa
import ServiceManagement
let badApps = [ "Code42 CrashPlan", "CrashPlanService", "CrashPlanLauncher", "CrashPlanWeb" ]
CollectionView.swift:111:24: error: method does not override any method from its superclass
open override func performBatchUpdates(_ updates: (() -> Void)?, completion: ((Bool) -> Void)? = nil) {
^
UIKit.UICollectionView:122:15: note: potential overridden instance method 'performBatchUpdates(_:completion:)' here
open func performBatchUpdates(_ updates: (() -> Swift.Void)?, completion: ((Bool) -> Swift.Void)? = nil)