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
  • 11:41 (UTC -03:00)
  • X @brunogama
View GitHub Profile
@brunogama
brunogama / convertPDFToPNG3x.sh
Created August 21, 2020 16:25 — forked from kampfgnu/convertPDFToPNG3x.sh
convert vector pdf to iOS image assets
#!/bin/bash -e
# convert vector pdf to iOS image assets
# copy this script to the folder where the pdf files live and run "./convertPDFToPNG3x.sh" in terminal.
# this will generate [filename]@3x.png, [filename]@2x.png and [filename].png images in the same folder
# Ensure we're running in location of script.
cd "`dirname $0`"
@brunogama
brunogama / svg-convert.sh
Created August 21, 2020 14:19 — forked from igorkulman/svg-convert.sh
SVG to PNG convert and resize
#!/bin/bash
# I made this script to convert SVG icons for an iOS app into PNG.
# The script will create icons in 3 sizes for different screen DPIs.
find "$(cd ..; pwd)" . -type f -name "*.svg" | while read f
do
FILENAME="${f%.*}"
echo '---'
inkscape -W "$FILENAME.svg"
@brunogama
brunogama / cases.swift
Created August 7, 2020 19:21 — forked from heestand-xyz/cases.swift
Swift Cases
import Foundation
fileprivate let badChars = CharacterSet.alphanumerics.inverted
public extension String {
var camelToTitleCased: String {
if self.count <= 1 {
return self.uppercased()
}
@brunogama
brunogama / README.md
Created July 3, 2020 17:30 — forked from jboehler/README.md
Xcode Behavior Script: Run SwiftLint & SwiftFormat only on modified files (using git to find modified files)

Xcode Behavior Script: Run SwiftLint & SwiftFormat

In Xcode settings you can define your own Behavior Scripts. This script will apply swiftlint and swiftformat to all modified files. The modified files are detected with the help of git.

Xcode Behavoior Script can be assigned with a shortcut so this script can be used to format swift code in xcode with a shortcut. 😎

Dependence:

@brunogama
brunogama / .swiftlint.auto.yml
Created June 28, 2020 12:22
Gist for .swiftlint.auto.yml
---
# Rules in this file will be automatically fixed. The script in Xcode must be
# changed to:
#
# if which swiftlint >/dev/null; then
# swiftlint autocorrect --config ".swiftlint.auto.yml" && swiftlint
# else
# echo "warning: SwiftLint not installed"
# echo "Download from https://github.com/realm/SwiftLint"
# fi
@brunogama
brunogama / RPScreenWriter.swift
Created March 31, 2020 17:10 — forked from mspvirajpatel/RPScreenWriter.swift
ScreenWriter With ReplayKit
import Foundation
import AVFoundation
import ReplayKit
class RPScreenWriter {
// Write video
var videoOutputURL: URL
var videoWriter: AVAssetWriter?
var videoInput: AVAssetWriterInput?
// Write audio
@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 / 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