Skip to content

Instantly share code, notes, and snippets.

View iwasrobbed's full-sized avatar
:shipit:
"1 billion years".Save()

rob phillips iwasrobbed

:shipit:
"1 billion years".Save()
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<access-policy>
<cross-domain-access>
<policy>
<allow-from http-request-headers="SOAPAction">
<domain uri="*"/>
</allow-from>
<grant-to>
<resource path="/" include-subpaths="true"/>
</grant-to>
@iwasrobbed
iwasrobbed / gist:1032395
Created June 17, 2011 21:29
Amazon S3 Query String Authentication for Ruby on Rails
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
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:5528897
Last active June 5, 2020 20:34
UICollectionView w/ NSFetchedResultsController & NSBlockOperation. Idea originated from Blake Watters (https://github.com/AshFurrow/UICollectionView-NSFetchedResultsController/issues/13)
- (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;
@iwasrobbed
iwasrobbed / TwitterReverseAuth
Last active August 29, 2015 13:57
Example of how to use AFOAuth1Client to do reverse auth of an ACAccount
//
// EvstReverseAuthExample.m
// Everest
//
// Created by Rob Phillips on 3/14/14.
//
#import <Accounts/Accounts.h>
#import "EvstReverseAuthExample.h"
#import "AFOAuth1Client.h"
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 / 0_reuse_code.js
Created June 16, 2016 19:40
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@iwasrobbed
iwasrobbed / example_hud.swift
Last active November 25, 2019 07:27
Example of how to create a HUD in Swift 3
//
// 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 / SwipeNavigationController.swift
Created April 16, 2017 05:12
Re-enables the interactivePopGestureRecognizer functionality that we lose when we implement our own back button handling.
/*
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 / me360.md
Created July 29, 2019 14:08
Me360 looking for first hire, full stack engineer

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