Skip to content

Instantly share code, notes, and snippets.

Eric Allam ericallam

Block or report user

Report or block ericallam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fc304adb5d98c5a08dcb2165858a431b
# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/eric/.ssh/id_rsa): /Users/eric/.ssh/digital_ocean_droplet
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/eric/.ssh/digital_ocean_droplet.
Your public key has been saved in /Users/eric/.ssh/digital_ocean_droplet.pub.
The key fingerprint is:
SHA256:TyU/FF3Z7bOS2MgIgTLu6yJBKkuOYUcMj6YjNJKq5a8 eric@Erics-MacBook-Pro-4.local
The key's randomart image is:
@ericallam
ericallam / application_service.rb
Created Jul 30, 2017
ApplicationService running a retryable REPEATABLE READ transaction
View application_service.rb
def call(form, attempts_count = 0, &block)
return block.call(form).unwrap unless transaction_handler.enabled?
return transaction_handler.transaction { block.call(form).unwrap } if nested_transaction_detector.call
if attempts_count < max_attempts
begin
attempts_count = attempts_count + 1
transaction_handler.transaction(isolation: :repeatable_read) { block.call(form, attempt: attempts_count).unwrap }
rescue Survivor::Adapters::Error => error
View gist:b80462362e5c730ea9281cf8646fa96c
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:Get*",
"s3:List*",
"s3:Put*"
],
@ericallam
ericallam / AppComponent.js
Last active Dec 25, 2018
Getting React Native's Navigator and Relay to work together
View AppComponent.js
import Relay, {
RootContainer,
Route
} from 'react-relay'
class SeasonRoute extends Route {
static paramDefinitions = {};
static queries = {
currentSeason: () => Relay.QL`query { currentSeason }`,
@ericallam
ericallam / RotateKeynoteDocumentDroplet
Created Jul 31, 2014
Rotate Keynote Document for use as an app Prototype
View RotateKeynoteDocumentDroplet
// Open Script Editor and Export this as an Application
//
// Then drop a keynote file on it in the Finder and it will properly resize
// and rotate everything so the Keynote file becomes usable as a prototype
// in the iPhone keynote app
// rotateDocument exported function
//
// Accepts a Keynote document and will rotate
// all the slides and elements in the slide 90 degrees
@ericallam
ericallam / AppDelegate.m
Created May 22, 2014
Interactive Animated Transition Example
View AppDelegate.m
//
// AppDelegate.m
// AnimationExamplesiPhone
//
// Created by Eric Allam on 10/05/2014.
#import "AppDelegate.h"
#pragma mark - UIColor Additions
@ericallam
ericallam / gist:11214298
Created Apr 23, 2014
Fixing animation snapback without setDisableActions:YES
View gist:11214298
// Implements the solution for solving "snapback" found in
// Chapter 8 of "iOS Core Animation Advanced Techniques" by Nick Lockwood
// without the need to use setDisableActions: to override the implicit animation,
// instead passing in the implicit animation key in addAnimation:forKey:
// With setDisableActions
- (void)applyBasicAnimation:(CABasicAnimation *)animation toLayer:(CALayer *)layer
{
//set the from value (using presentation layer if available)
animation.fromValue = [layer.presentationLayer ?: layer valueForKeyPath:animation.keyPath];
View Pragma.m
#pragma message("Use new block-based API once rdar://15641270 has been fixed")
View Apple Evangelists.txt
UI- and App Frameworks Evangelist - Jake Behrens, behrens@apple.com, twitter: @Behrens
- What's new in Cocoa
- Accessibility in iOS
- Building User Interfaces for iOS 7
- Getting Started with UIKit Dynamics
- What's new in Cocoa Touch
- What's New With Multitasking
- Best Practices for Cocoa Animation
- Improving Power Efficiency with App Nap
- Introducing Text Kit
View locationopens.d
syscall::open*:entry
/execname == "locationd"/
{
printf("locationd open %s\n", copyinstr(arg0));
}
You can’t perform that action at this time.