Skip to content

Instantly share code, notes, and snippets.

View KylePalko's full-sized avatar
💻
Somewhere coding

Kyle Palko KylePalko

💻
Somewhere coding
View GitHub Profile
@KylePalko
KylePalko / debug.sh
Created July 17, 2015 15:24
Kahlan/XDebug Script for PHPStorm
#!/bin/bash
export XDEBUG_CONFIG="idekey=PHPSTORM remote_host=localhost remote_port=9000 remote_handler=dbgp remote_enable=On"
php vendor/bin/kahlan
# This is for debugging KahLan Unit Tests in PHP.
# You'll need to install both XDebug and PHP on your machine to run.
# You can run the following if you have Homebrew to install:
## brew install php54-xdebug
## brew install php54
@KylePalko
KylePalko / lambda-api-gateway-cloudformation-example.yaml
Created September 12, 2017 15:41
An example CloudFormation Template for Lambda/API Gateway
Resources:
AccountsRestApi:
Type: "AWS::ApiGateway::RestApi"
Properties:
Name: "AccountsRestApi"
FailOnWarnings: "true"
AccountsResource:
Type: "AWS::ApiGateway::Resource"
Properties:
ParentId:
var data = {
UserPoolId: <YOUR_USER_POOL_ID>,
ClientId: <YOUR_USER_POOL_CLIENT_ID>,
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(data);
var cognitoUser = userPool.getCurrentUser();
try {
if (cognitoUser != null) {
cognitoUser.getSession(function(err, session) {