Skip to content

Instantly share code, notes, and snippets.

View pablocarrillo's full-sized avatar

Pablo Carrillo pablocarrillo

  • Calvium
  • Bristol
View GitHub Profile
@pablocarrillo
pablocarrillo / arrayOfIndexPathFromRange:Section:
Created September 6, 2013 09:31
Fast range of indexPath utility
/*!
*\brief Method to get an array of index path from a NSRange
* This method can be used to get an array of indexPath for table updates,
* just one range and section each time.
*\param range The range you need for the indexPath
*\param the section you want for the indexPath
*\return A Mutable array of NSIndexPath
*/
+ (NSMutableArray*)arrayOfIndexPathFromRange:(NSRange)range section:(NSUInteger)section{
@pablocarrillo
pablocarrillo / stringSerializerForQuery:
Created September 6, 2013 09:34
String serializer to change between parameters on array to coma separated string on HTML address
/*!
*\brief Method to serialize arrays
* This method serialized elements from an array an fill the space with the urlcode for querys
*\param array an array of nsstrings to be serialized
*\return NSString* a string with all the elements on the array serialized
*/
+ (NSString*)stringSerializerForQuery:(NSArray*)array{
NSMutableString *returnString;
//
// UIButton+AFNetworking.h
//
// Created by David Pettigrew on 6/12/12.
// Copyright (c) 2012 ELC Technologies. All rights reserved.
//
// Based upon UIImageView+AFNetworking.h
//
// Copyright (c) 2011 Gowalla (http://gowalla.com/)
@pablocarrillo
pablocarrillo / PCFancyButton.h
Last active December 22, 2015 20:09
This Gist work with [UIButton+AFNetworking.h]
//
// PCFancyButton.h
// RoundButton Test
//
// Created by Pablo Isidoro Carrillo Alvarez on 11/09/2013.
// Copyright (c) 2013 Pablo Isidoro Carrillo Alvarez.
//
// 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

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@pablocarrillo
pablocarrillo / correctPathForAutoenv.sh
Created May 28, 2014 22:52
Bash command to get correct path for autoenv
#!/bin/bash
#You can run this gist inside the folder that holds the venv folder or paste the following in a Terminal
#This file assume your virtual environment is under the folder venv
DIRECTORY=$(pwd) ; echo source $DIRECTORY/venv/bin/activate > .env
@pablocarrillo
pablocarrillo / gist:defc7a1c70472b3d8742
Last active August 29, 2015 14:04 — forked from MartinMoizard/gist:6537467
Present a modal view controller always
- (void)presentViewControllerFromVisibleViewController:(UIViewController *)viewControllerToPresent
{
if ([self isKindOfClass:[UINavigationController class]]) {
UINavigationController *navController = (UINavigationController *)self;
[navController.topViewController presentViewControllerFromVisibleViewController:viewControllerToPresent];
} else if (self.presentedViewController) {
[self.presentedViewController presentViewControllerFromVisibleViewController:viewControllerToPresent];
} else {
[self presentModalViewController:viewControllerToPresent animated:YES];
}
@pablocarrillo
pablocarrillo / API.md
Created August 6, 2014 10:18 — forked from iros/API.md

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

#!/bin/bash
# This file create a folder called resizedIcons in the same folder than the file
# in the first parameter and place inside all the resized copies
# The filename.png to resize
ITUNES_ARTWORK="$1"
FOLDER0=$(dirname "$ITUNES_ARTWORK")
FOLDER="${FOLDER0}/ResizedIcons"
# create the new folder
@pablocarrillo
pablocarrillo / Cloning Steps
Created December 17, 2014 13:29
Forking to bitbucket
```
git clone https://github.com/user/yourRepo
cd repo
git remote rename origin upstream
git remote add origin https://yourAccount@bitbucket.org/yourAccount/yourRepo
git push --mirror origin
```
Then make sure master will pull from the bitbucket repo (upstream being the name of the remote referring to the original GitHub repo)
```