Skip to content

Instantly share code, notes, and snippets.

@LeonardoCardoso
LeonardoCardoso / README.md
Last active October 30, 2018 09:56
RXMVVM Shell function

Usage

$ rxmvvm "AddressList" "LightPass" "Leonardo Cardoso" "1aim.com" .

  • $1 = Name of File
  • $2 = Name of Project
  • $3 = Name of Author
  • $4 = Website
  • $5 = Path
@LeonardoCardoso
LeonardoCardoso / GPG-Tower
Last active April 21, 2023 11:53
How to setup Tower to use the GPG Suite
# GPG on Tower
@LeonardoCardoso
LeonardoCardoso / GitHubDark.css
Created February 9, 2017 12:48
MacDown GitHubDark Theme
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
@LeonardoCardoso
LeonardoCardoso / UIViewControllerExtension.swift
Created January 22, 2017 00:54
Topmost View Controller
import UIKit
extension UIViewController {
static var topmostViewController: UIViewController? { return UIApplication.shared.keyWindow?.topmostViewController }
var topmostViewController: UIViewController? { return presentedViewController?.topmostViewController ?? self }
}
@LeonardoCardoso
LeonardoCardoso / combinations.py
Created November 29, 2016 12:30
Generate all combinations of a string, uppercase and lowercase.
def recurse (pref,suff):
# If no characters left, just print prefix.
if suff == "":
print pref
return
# Otherwise add lowercase of first suffix letter to prefix
# and recur with that and the remainder of the suffix.
# Then do the same for uppercase.
@LeonardoCardoso
LeonardoCardoso / change-screen-shot-location.sh
Created August 31, 2016 13:53
Change Screen Shot location on Mac
defaults write com.apple.screencapture location ~/PATH_YOU_WANT; killall SystemUIServer
@LeonardoCardoso
LeonardoCardoso / better-touch-tool.plist
Last active October 30, 2018 09:57
Script to keep BetterTouchTool running.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN” "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
@LeonardoCardoso
LeonardoCardoso / xcode-build-and-test.sh
Last active October 3, 2019 16:59
XCode Build and Test
xcodebuild -project YourProject.xcodeproj -scheme YourProjectScheme -destination "OS=10.0,name=iPhone 7" -sdk "iphonesimulator10.0" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty -c;
xcodebuild -project YourProject.xcodeproj -scheme YourProjectSchemeWatchOS -destination "OS=3.0,name=Apple Watch Series 2 - 42mm" -sdk "watchsimulator3.0" RUN_TESTS="NO" BUILD_EXAMPLE="NO" POD_LINT="NO" -configuration Debug ONLY_ACTIVE_ARCH=NO build | xcpretty -c;
xcodebuild -project YourProject.xcodeproj -scheme YourProjectSchemeTvOS -destination "OS=10.0,name=Apple TV 1080p" -sdk "appletvsimulator10.0" RUN_TESTS="YES" BUILD_EXAMPLE="NO" POD_LINT="NO" -configuration Debug ONLY_ACTIVE_ARCH=NO ENABLE_TESTABILITY=YES test | xcpretty -c;
xcodebuild -project YourProject.xcodeproj -scheme YourProjectSchemeMacOS -destination "arch=x86_64" -sdk "macosx10.12" RUN_TESTS="YES" BUILD_EXAMPLE="NO"
@LeonardoCardoso
LeonardoCardoso / DateConverterExtension.swift
Created July 4, 2016 12:50
Convert date from a format to another
extension String {
func convertDateDFormat(from: String = "yyyy-mm-dd", to: String = "EEE dd/mm/yyyy") -> String! {
let dateOriginalFormat = NSDateFormatter()
dateOriginalFormat.dateFormat = from
let dateDestinationFormat = NSDateFormatter()
dateDestinationFormat.dateFormat = to
@LeonardoCardoso
LeonardoCardoso / add-space-on-dock.sh
Created June 22, 2016 11:41
Add space on Mac's Dock
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'
killall Dock