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 keybase.md

Keybase proof

I hereby claim:

  • I am ericallam on github.
  • I am eallam (https://keybase.io/eallam) on keybase.
  • I have a public key ASBmNg1iFy8fqoyVlxPpWUjlx_FQi7wvtp0phG5or9ijhAo

To claim this, I am signing this object:

@ericallam
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 before-parameter-build.auto-scaling.CreateLaunchConfiguration
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.*.auto-scaling.CreateLaunchConfiguration.com
@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 / 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;
-(void)custom_startUpdatingLocation;
@ericallam
ericallam / AssemblyCompilationReporter.cs
Created Apr 10, 2018
Unity - Log Assembly Compilation times
View AssemblyCompilationReporter.cs
namespace Editor {
public class AssemblyCompilationReporter {
[InitializeOnLoadMethod]
private static void Init() {
CompilationPipeline.assemblyCompilationStarted += CompilationPipelineOnAssemblyCompilationStarted;
CompilationPipeline.assemblyCompilationFinished += CompilationPipelineOnAssemblyCompilationFinished;
}
private static void CompilationPipelineOnAssemblyCompilationFinished(string s, CompilerMessage[] compilerMessages) {
@ericallam
ericallam / app.coffee
Created Nov 8, 2011
Set certain regions of an Ace editor to readOnly
View app.coffee
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
View getblockchaininfo.json
{
"chain": "main",
"blocks": 0,
"headers": 16000,
"bestblockhash": "000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
"difficulty": 1,
"mediantime": 1231006505,
"verificationprogress": 3.715029412543562e-09,
"chainwork": "0000000000000000000000000000000000000000000000000000000100010001",
"pruned": false,
You can’t perform that action at this time.