Skip to content

Instantly share code, notes, and snippets.

View Ricardo1980's full-sized avatar

Ricardo Ruiz Lopez Ricardo1980

View GitHub Profile
@valeriomazzeo
valeriomazzeo / UIScrollView+Parallax.swift
Last active July 2, 2018 08:44
Add parallax effect to any scrollview subview
//
// UIScrollView+Parallax.swift
// Parallax
//
// Created by Valerio Mazzeo on 20/05/2016.
// Copyright © 2016 Valerio Mazzeo. All rights reserved.
//
import UIKit
@valeriomazzeo
valeriomazzeo / gist:6feeb07969edabba2326
Last active February 25, 2016 15:57
Dynamic TableHeaderView Height
- (void)viewDidLoad
{
[super viewDidLoad];
self.label = [[UILabel alloc] initWithFrame:CGRectZero];
self.label.translatesAutoresizingMaskIntoConstraints = NO;
self.label.backgroundColor = [UIColor redColor];
self.label.textAlignment = NSTextAlignmentCenter;
self.label.numberOfLines = 0;
self.label.text = @"Valerio adjkashdjk asdjk asd adj aklsdjasl dkjasdkl askldj aklsdj aklsddj aklsdj aklsdjaklsdj aklsdj aklsd Tiziano.";
@JadenGeller
JadenGeller / AnyEquatable.swift
Last active January 6, 2024 18:26
AnyEquatable
public struct AnyEquatable: Equatable {
private let value: Any
private let equals: Any -> Bool
public init<E: Equatable>(_ value: E) {
self.value = value
self.equals = { ($0 as? E == value) ?? false }
}
}
@epologee
epologee / NSBundle+TTTOverrideLanguage.h
Created October 11, 2013 19:26
Use method swizzling to change both language and locale at runtime, to use in your unit tests.
#import <Foundation/Foundation.h>
@interface NSBundle (TTTOverrideLanguage)
+ (void)ttt_overrideLanguage:(NSString *)language;
+ (void)ttt_resetLanguage;
@end
@Shilo
Shilo / NSString+Reverse.h
Last active April 24, 2018 18:44
A category for NSString to reverse string.
//
// NSString+Reverse.h
//
// Created by Shilo White on 9/1/13.
// Copyright (c) 2013 Shilocity Productions. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (Reverse)
@erikreagan
erikreagan / mac-apps.md
Created August 4, 2012 19:18
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@Ricardo1980
Ricardo1980 / UIDeviceHardware.h
Created June 22, 2012 14:58 — forked from Jaybles/UIDeviceHardware.h
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
+ (NSString *) platform;
+ (NSString *) platformString;