Skip to content

Instantly share code, notes, and snippets.

View jaderfeijo's full-sized avatar

Jader Feijo jaderfeijo

View GitHub Profile
@jaderfeijo
jaderfeijo / ExampleTest.m
Created January 5, 2022 09:19 — forked from pk/ExampleTest.m
Using method swizzling and blocks to test Class methods in Objective-C.
#import "SenTestCase+MethodSwizzling.m"
@interface ExampleTest : SenTestCase {}
+ (BOOL)trueMethod;
+ (BOOL)falseMethod;
@end
@implementation ExampleTest
+ (BOOL)trueMethod { return YES; }
@jaderfeijo
jaderfeijo / pull-private.sh
Created January 23, 2020 23:36 — forked from Avaq/pull-private.sh
Exporting and importing GPG keys over SSH
ssh user@remote gpg --export-secret-key KeyId | gpg --allow-secret-key-import --import
@jaderfeijo
jaderfeijo / 1-setup.md
Created September 5, 2019 13:35 — forked from troyfontaine/1-setup.md
Signing your Git Commits using GPG on MacOS Sierra/High Sierra

Methods of Signing with GPG

There are now two ways to approach this:

  1. Using gpg and generating keys
  2. Using Kryptonite by krypt.co

This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing with either GPG or Krypt.co.

@jaderfeijo
jaderfeijo / .vimrc
Last active May 23, 2019 15:19
.vimrc
let g:python_host_prog = '/Users/jaderfeijo/.pyenv/versions/neovim2/bin/python'
let g:python3_host_prog = '/Users/jaderfeijo/.pyenv/versions/neovim3/bin/python'
call plug#begin('~/.vim/plugged')
Plug 'https://github.com/keith/swift.vim.git'
Plug 'https://github.com/scrooloose/syntastic.git'
Plug 'https://github.com/mitsuse/autocomplete-swift.git'
Plug 'https://github.com/wincent/command-t.git'
Plug 'https://github.com/shime/vim-livedown.git'
@jaderfeijo
jaderfeijo / Collection+SafeElementRetrieval.swift
Last active June 19, 2018 10:14
Safe element retrieval for Swift collections
infix operator ~>: DefaultPrecedence
extension Collection {
/// Returns the element at the specified index if it is within bounds, otherwise nil.
///
/// This extension allows you to write code as follows:
/// - Example:
/// ```
/// if let element = array ~> index {
@jaderfeijo
jaderfeijo / SwiftyExpectations.swift
Last active June 11, 2018 15:20
SwiftyExpectations
//
// SwiftyExpectations.swift
//
// Created by Jader Feijo.
//
import Foundation
import XCTest
/// A wrapper around `XCTExpectation` which provides
@jaderfeijo
jaderfeijo / gist:c6ac4afbd3532bd86d0ee876062c2db7
Created May 2, 2018 16:07 — forked from nateware/gist:3915757
Start Mac VNC server from command line
# Step 1: Set priveleges
$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
Starting...
Setting allow all users to YES.
Setting all users privileges to 1073742079.
Done.
# Step 2: Allow VNC clients
@jaderfeijo
jaderfeijo / launch
Last active March 13, 2018 10:46
launch
#!/usr/bin/ruby
require 'json'
require 'plist'
def archive_build(solution, project, configuration)
return system("/Applications/Xamarin\\ Studio.app/Contents/MacOS/mdtool -v archive -c:\"#{configuration}|iPhone\" -p:\"#{project}\" \"#{solution}\"");
end
def export_archive(export_options, archive_path, project_name)
@jaderfeijo
jaderfeijo / xcarchive
Last active March 13, 2018 10:46
xcarchive
#!/usr/bin/env ruby
require 'optparse'
require 'ostruct'
require 'plist'
require 'pp'
class Archive
ARCHIVES_ROOT = File.join(File.expand_path('~'), "Library/Developer/Xcode/Archives")
@jaderfeijo
jaderfeijo / post-checkout
Last active March 13, 2018 10:46
.git/post-checkout
#!/usr/bin/env bash
diff Podfile.lock Pods/Manifest.lock > /dev/null
if [[ $? != 0 ]]; then
echo "*** Podfile changed ***"
pod install
fi