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
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];

Keybase proof

I hereby claim:

  • I am ericallam on github.
  • I am eallam ( on keybase.
  • I have a public key ASBmNg1iFy8fqoyVlxPpWUjlx_FQi7wvtp0phG5or9ijhAo

To claim this, I am signing this object:

ericallam / gist:1019446
Created Jun 10, 2011
How to log all queries for a PostgreSQL homebrew install on OS X
View gist:1019446

Open the postgresql.conf config file:

$> mate /usr/local/var/postgres/postgresql.conf

Uncomment the line with 'log_destination' and set it to 'syslog'

log_destination = 'syslog'

Open the syslog config:

View gist:fc719b79e8d300a790c3dd74e97c854d
2019-03-19 11:45:41 Using SAM Template at /Users/eric/code/Solve/opensource/ship-logs-to-honeycomb/template.yml
2019-03-19 11:45:41 Changing event name from creating-client-class.iot-data to creating-client-class.iot-data-plane
2019-03-19 11:45:41 Changing event name from before-call.apigateway to before-call.api-gateway
2019-03-19 11:45:41 Changing event name from request-created.machinelearning.Predict to request-created.machine-learning.Predict
2019-03-19 11:45:41 Changing event name from before-parameter-build.autoscaling.CreateLaunchConfiguration to
2019-03-19 11:45:41 Changing event name from before-parameter-build.route53 to before-parameter-build.route-53
2019-03-19 11:45:41 Changing event name from request-created.cloudsearchdomain.Search to request-created.cloudsearch-domain.Search
2019-03-19 11:45:41 Changing event name from docs.*.autoscaling.CreateLaunchConfiguration.complete-section to docs.*
ericallam / AppComponent.js
Last active Dec 25, 2018
Getting React Native's Navigator and Relay to work together
View AppComponent.js
import Relay, {
} from 'react-relay'
class SeasonRoute extends Route {
static paramDefinitions = {};
static queries = {
currentSeason: () => Relay.QL`query { currentSeason }`,
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
View CLLocationManager+MockingLocation.h
#import <CoreLocation/CoreLocation.h>
extern CLLocationDegrees kMockedLatitude;
extern CLLocationDegrees kMockedLongitude;
@interface CLLocationManager (MockingLocation)
+ (BOOL)custom_locationServicesEnabled;
+ (CLAuthorizationStatus)custom_authorizationStatus;
ericallam / AssemblyCompilationReporter.cs
Created Apr 10, 2018
Unity - Log Assembly Compilation times
View AssemblyCompilationReporter.cs
namespace Editor {
public class AssemblyCompilationReporter {
private static void Init() {
CompilationPipeline.assemblyCompilationStarted += CompilationPipelineOnAssemblyCompilationStarted;
CompilationPipeline.assemblyCompilationFinished += CompilationPipelineOnAssemblyCompilationFinished;
private static void CompilationPipelineOnAssemblyCompilationFinished(string s, CompilerMessage[] compilerMessages) {
ericallam /
Created Nov 8, 2011
Set certain regions of an Ace editor to readOnly
event = require('pilot/event')
Anchor = require('ace/anchor').Anchor
doc = ace_editor.session.getDocument()
editablePositions = [[1, 0, 2, 0]] # allow editong only the second row
jQuery.each editable, (index, row) ->
editablePositions.push [new Anchor(doc, row[0], row[1]), new Anchor(doc, row[2], row[3])]
Range = require('ace/range').Range
You can’t perform that action at this time.