Skip to content

Instantly share code, notes, and snippets.

View fjcaetano's full-sized avatar
⌨️

Flávio Caetano fjcaetano

⌨️
View GitHub Profile
@insidegui
insidegui / PwnageVerifier.swift
Last active September 30, 2018 11:42
Uses the pwnedpasswords API to verify password integrity
/*
By default, this class requires https://github.com/idrougge/sha1-swift to work,
you can replace the default SHA1 implementation by setting the hash property to a function
that takes a String and returns an optional String (the SHA1 hex string of the input)
*/
/// Uses the pwnedpasswords API to verify password integrity
public final class PwnageVerifier {
/// The base URL for the pwnedpasswords service (a default is provided by the initializer)
@julesjans
julesjans / screen-gif.sh
Last active May 8, 2021 16:40
Capture iOS Simulator to animated gif
# Turn on the simulator screen capture
xcrun simctl io booted recordVideo ~/simulator.mov
# Convert the iPhone 6s screen shot into a gif:
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif
@orta
orta / gist:162b4152e6c2137de423
Created May 8, 2014 10:01
CocoaPods Licenses
9329 MIT
887 Apache License, Version 2.0
854 BSD
620 Commercial
255 zlib
247 Copyright
170 2-clause BSD
151 Apache
104 MIT License
102 Apache 2.0
@mywizz
mywizz / gist:8806645
Created February 4, 2014 16:07
DLog
#ifdef DEBUG
# define DLog(...) NSLog(__VA_ARGS__)
#else
# define DLog(...)
#endif
#define ALog(...) NSLog(__VA_ARGS__)
@thiagoperes
thiagoperes / gist:5887917
Created June 28, 2013 20:38
Helper functions to calculate the distance between two coordinates and to create a distance string
CLLocationDistance distanceBetweenCoordinates(CLLocationDegrees startLat, CLLocationDegrees startLng,
CLLocationDegrees endLat, CLLocationDegrees endLng)
{
CLLocation *locA = [[CLLocation alloc] initWithLatitude:startLat
longitude:startLng];
CLLocation *locB = [[CLLocation alloc] initWithLatitude:endLat
longitude:endLng];
return [locA distanceFromLocation:locB];
@gavrix
gavrix / gist:5054182
Created February 28, 2013 04:28
Script integrating OCLint into XCode. Put it in "Run script" build phase.
source ~/.bash_profile
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@MaximKeegan
MaximKeegan / xcode_ramdisk.sh
Created April 12, 2012 03:28
Create a RAM disk for using with XCode
#!/bin/sh
# Create a RAM disk with same perms as mountpoint
# Script based on http://itux.idev.pro/2012/04/iservice-speed-up-your-xcode-%D0%BD%D0%B5%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D1%8B%D0%B5-%D1%81%D0%BF%D0%BE%D1%81%D0%BE%D0%B1%D1%8B/ with some additions
# Usage: sudo ./xcode_ramdisk.sh start
USERNAME=$(logname)
TMP_DIR="/private/tmp"
RUN_DIR="/var/run"
SYS_CACHES_DIR="/Library/Caches"
@shripadk
shripadk / gist:552554
Created August 27, 2010 00:59
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS