Skip to content

Instantly share code, notes, and snippets.

View idiogo's full-sized avatar

Diogo Carneiro idiogo

View GitHub Profile
@idiogo
idiogo / String+Additions.swift
Created January 28, 2017 12:48 — forked from perlmunger/String+Additions.swift
Some helpful string extensions in Swift 2
extension String
{
var length: Int {
get {
return self.characters.count
}
}
func contains(s: String) -> Bool {
return self.rangeOfString(s) != nil ? true : false
@idiogo
idiogo / install-git-completion.sh
Created January 24, 2017 15:02 — forked from johngibb/install-git-completion.sh
Mac OS X - Install Git Completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@idiogo
idiogo / UIView+CMExtras.h
Created April 13, 2016 16:59 — forked from chrismiles/UIView+CMExtras.h
UIView class extension with some of my handy convenience methods
//
// UIView+CMExtras.h
//
// Created by Chris Miles on 9/06/11.
// Copyright 2011 Chris Miles.
//
// 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
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell