Skip to content

Instantly share code, notes, and snippets.

View pablocarrillo's full-sized avatar

Pablo Carrillo pablocarrillo

  • Calvium
  • Bristol
View GitHub Profile
//
// 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/)

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 / 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 / finder-open-iterm-here.scpt
Created June 5, 2016 12:18 — forked from inderpreet99/finder-open-iterm-here.scpt
Finder Open iTerm Here: Drop a folder on this script (or just run it) to open a new iTerm window there. If the selected item isn't a folder, it will open the item's parent folder. Great when bound to a hotkey in FastScripts or added to the Finder Sidebar. Works with iTerm2-v3 (2.9)
(*
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*)
tell application "Finder"
@pablocarrillo
pablocarrillo / gist:a6e41f492c4a6ba5e2729d1b73a26111
Created September 16, 2016 14:40 — forked from zackdever/gist:8701478
arc diff off another diff
taken directly from https://sites.google.com/a/khanacademy.org/forge/for-developers/code-review-policy/using-phabricator
Advanced topic: Dependent Phabricator reviews
Say you have an upstream called master, and a feature branch F1, and a second change that depends on F1, (call it F2).
git checkout master
git checkout -b F1
# work work
git commit -a
arc diff
@pablocarrillo
pablocarrillo / ubuntu-hardening.md
Created February 2, 2020 20:55 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

sudo apt-get update
sudo apt-get upgrade
sudo apt-get autoremove
sudo apt-get autoclean