Skip to content

Instantly share code, notes, and snippets.

View iangmaia's full-sized avatar

Ian Guedes Maia iangmaia

View GitHub Profile
@iangmaia
iangmaia / search-sha256-key-fingerprint.sh
Created May 22, 2024 16:09
Search for a SHA256 fingerprint in key files within a directory
#!/bin/bash
extract_fingerprint() {
ssh-keygen -lf "$1" -E sha256 2>/dev/null | awk '{print $2}'
}
if [ "$#" -ne 2 ]; then
echo "Usage: $0 <DIRECTORY> <SHA256_FINGERPRINT>"
exit 1
fi
@iangmaia
iangmaia / TrelloHash.swift
Created February 10, 2016 13:38
Solution for the Trello iOS coding challenge
//
// TrelloHash.swift
// TrelloHash
//
// Created by Ian Guedes Maia on 09/02/16.
// Copyright © 2016 Ian Guedes Maia. All rights reserved.
//
import Foundation
@iangmaia
iangmaia / getLaunchScreen.swift
Created January 6, 2016 14:42
Get Launch Screen Image Name
static private func splashImageForOrientation() -> String {
let viewSize = UIScreen.mainScreen().bounds.size
let viewOrientation = "Portrait"
let imagesDict = NSBundle.mainBundle().infoDictionary as Dictionary<NSObject, AnyObject>!
let imagesArray = imagesDict["UILaunchImages"] as! NSArray
for dict in imagesArray {
let dictNSDict = dict as! NSDictionary
let imageSize = CGSizeFromString(dictNSDict["UILaunchImageSize"] as! String)
if CGSizeEqualToSize(imageSize, viewSize) && viewOrientation == (dictNSDict["UILaunchImageOrientation"] as! String) {
return dictNSDict["UILaunchImageName"] as! String
@iangmaia
iangmaia / JSONKit.podspec
Last active August 29, 2015 14:23
JSONKit.podspec
# podspec pointing to a fixed JSONKit (dependency of the SoundCloud SDK)
Pod::Spec.new do |s|
s.name = 'JSONKit'
s.version = '1.5pre'
s.license = 'BSD / Apache License, Version 2.0'
s.summary = 'A Very High Performance Objective-C JSON Library.'
s.homepage = 'https://github.com/heroims/JSONKit'
s.author = 'John Engelhart'
s.source = { :git => 'https://github.com/kelp404/JSONKit', :commit => '60b81aeebe7c184e32e9716c2a6891a9a84d4084' }
s.compiler_flags = '-fno-objc-arc'
@iangmaia
iangmaia / ffmpegios.sh
Created September 29, 2012 17:05
Script to build ffmpeg for iOS
#ios 6.0 sdk and min version 4.3. No armv6 support. Tested with ffmpeg 0.8.X.
rm -r ./compiled
echo Configure for armv7 build
./configure \
--cc=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc \
--as='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' \
--nm="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/nm" \
--sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk \
--target-os=darwin \