Skip to content

Instantly share code, notes, and snippets.

View felipesouto's full-sized avatar

Felipe Souto felipesouto

  • Vila Velha, Espírito Santo, Brazil
View GitHub Profile
@pokeb
pokeb / gist:150447
Created July 20, 2009 17:03
An example showing how to manage a queue with ASIHTTPRequest
//
// MyController.h
//
// Created by Ben Copsey on 20/07/2009.
// Copyright 2009 All-Seeing Interactive. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <GHUnit/GHUnit.h>
@class ASINetworkQueue;
@christoph-jerolimov
christoph-jerolimov / SdcardFolder.java
Created January 10, 2011 11:33
Load Android SDCard Folder for different devices (Android Standard, Samsung Galaxy S, HTC Incredible)
private String getSdcardFolder() {
File externalStorage = Environment.getExternalStorageDirectory();
if (externalStorage.exists() && externalStorage.canWrite()) {
File trySubDir1 = new File(externalStorage, "external_sd");
File trySubDir2 = new File(externalStorage, "sd");
if (trySubDir1.exists() && trySubDir1.canWrite()) {
return trySubDir1.getAbsolutePath();
} else if (trySubDir2.exists() && trySubDir2.canWrite()) {
return trySubDir2.getAbsolutePath();
} else {
@leohackin
leohackin / rastrear_encomenda_correios_for_mac
Last active September 24, 2015 21:27
Script para rastreamento contínuo de encomenda nos Correios via linha de comando for Mac.
#!/bin/bash
# Created by Léo Hackin (leohackin at gmail.com), Jan 2011
# This file is free software. You are free to use this file in any way you like
# However, if you change it you should note in this file that you did and who
# you are, you also need to change the version string if you do. That way
# I will not get support questions for software that is not entirely mine.
# rastreia_encomenda_correios v.0.1a for mac
@boctor
boctor / BaseViewController.m
Created May 5, 2011 02:08
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@mnem
mnem / NSMutableArray+Shuffle.h
Created August 19, 2011 12:44
NSMutableArray category for Fisher–Yates style shuffling. See http://en.wikipedia.org/wiki/Fisher–Yates_shuffle
/**
* NSMutableArray+Shuffle.h
*
* (c) Copyright 2011 David Wagner.
*
* Complain/commend: http://noiseandheat.com/
*
*
* Licensed under the MIT license:
*
@dhoerl
dhoerl / KeychainItemWrapper.h
Last active June 19, 2025 07:10
KeychainItemWrapper ARCified. Added the ability to manage a dictionary in place of just a string - the #define PASSWORD_USES_DATA in the .m file switches the mode.
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
+(UIView *)fetchViewFromNib:(NSString *)nibName withClass:(Class)viewClass {
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil];
UIView *view = nil;
for (id object in nibObjects) {
if ([object isKindOfClass:viewClass]) {
view = object;
@TonnyXu
TonnyXu / UITableView_SeparatorLine.md
Created May 10, 2012 13:21
set UITableView.separatorLine to 2px and with different colors each pixel

Question

How to implement a UITableView with a separator line like this:

doubly separator line

Usually, you can only set the separatorLine property of a UITableView with to single line or single line etched. Sometimes, it is not enough. So, how to implement a separator line like this?

Answer

@0xced
0xced / XCDFakeCarrier.m
Last active March 5, 2023 22:07
Hack to choose the displayed carrier name in the iOS simulator
//
// Copyright (c) 2012-2015 Cédric Luthi / @0xced. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_SIMULATOR
static const char *fakeCarrier;
static const char *fakeTime;
@nfarina
nfarina / UIView+FrameAdditions.h
Created August 21, 2012 06:40
UIView Frame helper getter/setter category methods
#import <UIKit/UIKit.h>
@interface UIView (SMFrameAdditions)
@property (nonatomic, assign) CGPoint $origin;
@property (nonatomic, assign) CGSize $size;
@property (nonatomic, assign) CGFloat $x, $y, $width, $height; // normal rect properties
@property (nonatomic, assign) CGFloat $left, $top, $right, $bottom; // these will stretch the rect
@end