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 / 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
@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 / 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 / EsampleSwift.swift
Last active August 29, 2015 14:22
PromiseKit 2 Example with Promise<T>
//
// ViewController2.swift
//
// Created by Pablo Carrillo on 09/06/2015.
// Copyright (c) 2015 Calvium. All rights reserved.
//
import UIKit
import Alamofire
import PromiseKit
@pablocarrillo
pablocarrillo / ModalTransitionAnimator.h
Created December 17, 2014 15:40
Modal transition animators, to make a lateral animation from the left. based on: https://github.com/pronebird/CustomModalTransition/
//
// ModalTransitionAnimator.h
// CustomModalTransition
//
// Created by pronebird on 29/05/14.
// Copyright (c) 2014 codeispoetry.ru. All rights reserved.
//
#import <Foundation/Foundation.h>
@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)
```
#!/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 / 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:

@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 / 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