Skip to content

Instantly share code, notes, and snippets.

Bruno Gama brunogama

Block or report user

Report or block brunogama

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cmyk2rbg
#!/bin/bash
##########################################################
# Based in the sample script from the link: #
# "Can I convert an image from CMYK to RGB in Mac OS X?" #
# http://superuser.com/a/117489 #
##########################################################
if [ -z "$1" ]; then
@brunogama
brunogama / checks.zsh
Created Aug 18, 2019
Filesystem checks
View checks.zsh
#!/usr/bin/env zsh
case "$OSTYPE" in
darwin*) IS_OSX=1 ;;
solaris*) IS_SOLARIS=1 ;;
linux*) IS_LINUX=1 ;;
bsd*) IS_BSD=1 ;;
*) ;;
esac
@brunogama
brunogama / git-commit-template
Last active Jan 9, 2019
Git commit template
View git-commit-template
# |<---- Using a Maximum Of 50 Characters ---->|
Type:
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
Description:
# Ticket (Github issue #23, or Jira format)
Ticket:
# END -----------------------------------------------------------------
@brunogama
brunogama / XcodeBuildSettingsReference.md
Created Dec 11, 2018 — forked from NSExceptional/XcodeBuildSettingsReference.md
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2
View XcodeBuildSettingsReference.md

Build settings reference

Active Build Action (ACTION)

A string identifying the build system action being performed.

Additional SDKs (ADDITIONAL_SDKS)

The locations of any sparse SDKs that should be layered on top of the one specified by Base SDK (SDKROOT). If more than one SDK is listed, the first one has highest precedence. Every SDK specified in this setting should be a "sparse" SDK, for example, not an SDK for an entire macOS release.

Alternate Install Group (ALTERNATE_GROUP)

@brunogama
brunogama / .git-commit-template.txt
Created Jul 7, 2018 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
View .git-commit-template.txt
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23
@brunogama
brunogama / Bookmarkified
Created Apr 3, 2018 — forked from lemieuxster/Bookmarkified
QR Code Bookmarklet
View Bookmarkified
javascript:(function(window, document, undefined) {try {var selectedText = document.getSelection().toString(); if (selectedText === ''){selectedText = window.location.href;} if(selectedText !== ''){var baseQRUrl = 'http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=' + encodeURIComponent(selectedText); window.open(baseQRUrl, '_blank', 'width=400,height=400');}} catch (e) {}})(window, document);
@brunogama
brunogama / UIViewController+StoryboardInstantiable.swift
Created Mar 22, 2018
UIViewController+StoryboardInstantiable
View UIViewController+StoryboardInstantiable.swift
public protocol StoryboardInstantiable: class {
static func fromStoryboard(name: String, bundle: Bundle?) -> Self
}
extension StoryboardInstantiable where Self: UIViewController {
static func fromStoryboard(name: String = "Main", bundle: Bundle? = nil) -> Self {
let identifier = String(describing: self)
let storyboard = UIStoryboard(name: name, bundle: bundle)
guard let viewController =
storyboard.instantiateViewController(withIdentifier: identifier) as? Self else {
@brunogama
brunogama / pre-commit
Created Dec 27, 2017 — forked from candostdagdeviren/pre-commit
Git Pre-Commit hook with SwiftLInt
View pre-commit
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
@brunogama
brunogama / web-servers.md
Created Aug 15, 2017 — forked from willurd/web-servers.md
Big list of http static server one-liners
View web-servers.md

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@brunogama
brunogama / String.swift
Created Aug 11, 2017
Localized string extension
View String.swift
public extension String
{
public var localized: String {
return NSLocalizedString(self.lowercased(), tableName: nil, bundle: .main, value: "", comment: "")
}
}
You can’t perform that action at this time.