Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
Working hard for the money

rob phillips iwasrobbed

:shipit:
Working hard for the money
View GitHub Profile
View CurrencySymbol.swift
final class CurrencySymbol {
static let shared = CurrencySymbol()
/// Finds the shortest currency symbol possible and formats the amount with it
/// Note: this works around using `currencyCode` and how it displays `CA$1234.56` instead of `$1234.56`
func currencyString(for amount: Decimal, isoCurrencyCode: String?) -> String {
guard let isoCurrencyCode = isoCurrencyCode,
let currencySymbol = findSymbol(for: isoCurrencyCode)
else { return String(describing: amount) }
return formatter(for: currencySymbol).string(for: amount) ?? String(describing: amount)
@iwasrobbed
iwasrobbed / me360.md
Created Jul 29, 2019
Me360 looking for first hire, full stack engineer
View me360.md

Me360 is a start up focused on delivering effective employee training at scale for high impact professional skills. I (founder) have been collaborating with a great engineer friend and former colleague to develop the initial versions of the product, and now with some market traction it's time to formalize a small core team.

I'm looking to hire the first full-time fullstack engineer for the company who would own all the technical work and direction for the next year. We'd work very closely together (I have a product and start up background), alongside a contract designer. After year one, they'd likely build out their team.

This company has ambitions to be a high growth tech company and deliver a meaningful solution to help professionals advance their careers with really powerful skills. It's a great opportunity for someone who's interested in this mission, who enjoys start up life and quick release cycles, and who's a dynamic problem solver at introducing relevant technologies to

@iwasrobbed
iwasrobbed / SwipeNavigationController.swift
Created Apr 16, 2017
Re-enables the interactivePopGestureRecognizer functionality that we lose when we implement our own back button handling.
View SwipeNavigationController.swift
/*
This class re-enables the interactivePopGestureRecognizer
functionality that we lose when we implement our own back button handling.
It disables the pop gesture in three scenarios:
1) when the user is still on the root view controller
2) when a push animation is in progress
3) when the user swipes quickly multiple times and animations don't have time to be performed
*/
@iwasrobbed
iwasrobbed / example_hud.swift
Last active Nov 25, 2019
Example of how to create a HUD in Swift 3
View example_hud.swift
//
// HUD.swift
//
// Created for a coding challenge called FoodDictator
//
// This example relies on SwiftyGif to show an animated GIF for progress,
// but you could just as easily replace it with something like RPCircularProgress.
//
// Links for both are below:
// SwiftyGif: https://github.com/kirualex/SwiftyGif
@iwasrobbed
iwasrobbed / 0_reuse_code.js
Created Jun 16, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View gist:9d1cf7ddc96413023d7c
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x3a0b1214 bool objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::LookupBucketFor<objc_object*>(objc_object* const&, std::__1::pair<objc_object*, unsigned long> const*&) const + 3
1 libobjc.A.dylib 0x3a0b1013 objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&) + 22
2 libobjc.A.dylib 0x3a0b1013 objc::DenseMapBase<objc::DenseMap<objc_object*, unsigned long, true, objc::DenseMapInfo<objc_object*> >, objc_object*, unsigned long, objc::DenseMapInfo<objc_object*>, true>::find(objc_object* const&) + 22
3 libobjc.A.dylib 0x3a0afaf3 objc_object::sidetable_release(bool) + 54
4 Everest 0x001e319d -[JDSt
@iwasrobbed
iwasrobbed / TwitterReverseAuth
Last active Aug 29, 2015
Example of how to use AFOAuth1Client to do reverse auth of an ACAccount
View TwitterReverseAuth
//
// EvstReverseAuthExample.m
// Everest
//
// Created by Rob Phillips on 3/14/14.
//
#import <Accounts/Accounts.h>
#import "EvstReverseAuthExample.h"
#import "AFOAuth1Client.h"
@iwasrobbed
iwasrobbed / gist:5528897
Last active Jun 5, 2020
UICollectionView w/ NSFetchedResultsController & NSBlockOperation. Idea originated from Blake Watters (https://github.com/AshFurrow/UICollectionView-NSFetchedResultsController/issues/13)
View gist:5528897
- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
{
self.shouldReloadCollectionView = NO;
self.blockOperation = [[NSBlockOperation alloc] init];
}
- (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id<NSFetchedResultsSectionInfo>)sectionInfo
atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type
{
__weak UICollectionView *collectionView = self.collectionView;
View gist:1095033
class ImageUploader < CarrierWave::Uploader::Base
# include MiniMagick support for resizing images
include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
# (handled in the initializer file)
# storage :file
# storage :fog
# Override the directory where uploaded files will be stored.
@iwasrobbed
iwasrobbed / gist:1032395
Created Jun 17, 2011
Amazon S3 Query String Authentication for Ruby on Rails
View gist:1032395
def generate_secure_s3_url(s3_key)
#
# s3_key would be a path (including filename) to the file like: "folder/subfolder/filename.jpg"
# but it should NOT contain the bucket name or a leading forward-slash
#
# this was built using these instructions:
# http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?S3_QSAuth.html
# http://aws.amazon.com/code/199?_encoding=UTF8&jiveRedirect=1
s3_base_url = MyApp::Application::S3_BASE_URL # i.e. https://mybucket.s3.amazonaws.com