Skip to content

Instantly share code, notes, and snippets.

View jaderfeijo's full-sized avatar

Jader Feijo jaderfeijo

View GitHub Profile
@jaderfeijo
jaderfeijo / Date+TimeOfDay.swift
Last active March 13, 2018 10:45
Date+TimeOfDay.swift
//
// Date+TimeOfDay.swift
// Created by: Jader Feijo
//
import Foundation
extension Date {
enum TimeOfDay {
case morning
@jaderfeijo
jaderfeijo / String+Dates.swift
Last active March 13, 2018 10:45
String+Dates.swift
//
// String+Dates.swift
// Created by Jader Feijo on 14/10/2016.
//
import Foundation
extension String {
func asDate(withFormat format: String) -> Date? {
let formatter = DateFormatter()
@jaderfeijo
jaderfeijo / String+MD5.swift
Last active March 13, 2018 10:45
String+MD5.swift
//
// String+MD5.swift
// Created by: Jader Feijo
//
import Foundation
extension String {
var md5: String {
var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH))
@jaderfeijo
jaderfeijo / String+EmailValidation.swift
Last active March 13, 2018 10:45
String+EmailValidation.swift
//
// String+EmailValidation.swift
// Created by: Jader Feijo
//
import Foundation
extension String {
var isValidEmail: Bool {
do {
@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
@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 / 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 / .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 / trinity
Last active March 1, 2016 16:37
trinity
ssh $1@$2 "osascript -e 'tell application \"Terminal\" to activate' -e 'tell application \"Terminal\" to do script \"nc -l 1234\"' >> /dev/null"
sleep 3
telnet $2 1234
@jaderfeijo
jaderfeijo / git-rm-tag
Last active March 1, 2016 16:38
git-rm-tag
#!/bin/bash
git tag -d $1 & git push $2 :refs/tags/$1