Skip to content

Instantly share code, notes, and snippets.

View brunogama's full-sized avatar
🏠
Working from home

Bruno Gama brunogama

🏠
Working from home
  • Banco Inter
  • Brazil
  • 07:31 (UTC -03:00)
  • X @brunogama
View GitHub Profile
@brunogama
brunogama / WifiReceiver.java
Created December 4, 2019 19:51 — forked from JordyCuan/WifiReceiver.java
Broadcast receiver to detect when wifi connects on an Android device, displaying the SSID name and MAC address in a notfication
//
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
@brunogama
brunogama / certs.sh
Created November 25, 2019 20:51 — forked from joakinen/certs.sh
Converting certificates
#!/bin/sh
# ____ _____ ____ _____ ___ _____ ___ ____ _ _____ _____ ____
# / ___| ____| _ \_ _|_ _| ___|_ _/ ___| / \|_ _| ____/ ___|
# | | | _| | |_) || | | || |_ | | | / _ \ | | | _| \___ \
# | |___| |___| _ < | | | || _| | | |___ / ___ \| | | |___ ___) |
# \____|_____|_| \_\|_| |___|_| |___\____/_/ \_\_| |_____|____/
# ____ _______ __
# | _ \| ___\ \/ /
@brunogama
brunogama / qrcode.swift
Created November 21, 2019 19:26
There's no need to download third party software when you can execute this code and generate your own qr-code generator qr-code.playground 😀
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
final class QRCodeViewController: UIViewController {
private var input: String = ""
func generateQRCode(from string: String) -> UIImage? {
let data = string.data(using: String.Encoding.ascii)
#!/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 August 18, 2019 18:28
Filesystem checks
#!/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 January 9, 2019 20:30
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 December 11, 2018 11:12 — forked from NSExceptional/XcodeBuildSettingsReference.md
The Xcode Build Settings Reference in a searchable document, as of Xcode 8.3.2

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 July 7, 2018 21:16 — forked from adeekshith/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <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 April 3, 2018 15:56 — forked from lemieuxster/Bookmarkified
QR Code Bookmarklet
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 March 22, 2018 18:33
UIViewController+StoryboardInstantiable
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 {