Skip to content

Instantly share code, notes, and snippets.

View dogo's full-sized avatar
💭
Olympus! Tremble before me!

Diogo Autilio dogo

💭
Olympus! Tremble before me!
View GitHub Profile
@dogo
dogo / gist:ff80995b9da640a7ab5332c0e831f170
Created September 30, 2020 06:58
List git branches created by user
git for-each-ref --format=' %(authorname) %09 %(refname)' --sort=authorname
extension URLRequest {
/**
Returns a cURL command representation of this URL request.
*/
public var curlString: String {
guard let url = url else { return "" }
var baseCommand = "curl \(url.absoluteString)"
if httpMethod == "HEAD" {
import Foundation
import CommonCrypto
// Defines types of hash string outputs available
public enum HashOutputType {
// standard hex string output
case hex
// base 64 encoded string output
case base64
}
import Foundation
import CommonCrypto
extension Data {
/// Hashing algorithm that prepends an RSA2048ASN1Header to the beginning of the data being hashed.
///
/// - Parameters:
/// - type: The type of hash algorithm to use for the hashing operation.
/// - output: The type of output string desired.
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch bitbucket-pipelines.yml' --prune-empty --tag-name-filter cat -- --all
git push origin --force --all
git push origin --force --tags
@dogo
dogo / Fat-Framework.sh
Created February 20, 2019 13:10
Post archive script to generate Fat-Framework for Xcode 10.x or newer
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@dogo
dogo / Fat-Framework.sh
Created February 20, 2019 13:08
Post archive script to generate Fat-Framework for Xcode 9.x or older
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
extension UIView {
func asImage() -> UIImage? {
if #available(iOS 10.0, *) {
let renderer = UIGraphicsImageRenderer(bounds: bounds)
return renderer.image { rendererContext in
layer.render(in: rendererContext.cgContext)
}
} else {
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.isOpaque, 0.0)
/*! \file HttpStatusCode.swift*/
// HttpStatusCode.swift
//
//
// Created by Diogo Autilio on 7/29/15.
// Updated on 9/26/18.
// Copyright (c) 2015 Anykey Entertrainment. All rights reserved.
//
/**
/*! \file HTTPStatusCodes.h*/
// HTTPStatusCodes.h
//
//
// Created by Diogo Autilio on 7/29/15.
// Copyright (c) 2015 Anykey Entertrainment. All rights reserved.
//
#ifndef HTTPStatusCodes_h
#define HTTPStatusCodes_h