Skip to content

Instantly share code, notes, and snippets.

View jeffski's full-sized avatar

Jeff Shillitto jeffski

View GitHub Profile
@jeffski
jeffski / da-vinci.json
Last active June 24, 2019 05:17
Da Vinci quote. Example video JSON
{
"timeline": {
"soundtrack": {
"src": "https://s3-ap-southeast-2.amazonaws.com/shotstack-assets/music/spirit.mp3",
"effect": "fadeInFadeOut"
},
"background": "#000000",
"tracks": [
{
"clips": [
@jeffski
jeffski / gist:b955d3eb2c60c5fcac0f36e144d5bc0c
Created October 27, 2017 01:08
Ethereum Testnet Faucet Request
0xAd3dA99af3F4C3eE660842cf14aC2933349BF3d4
@jeffski
jeffski / s3-upload-policy-restricted
Last active June 23, 2017 05:01
Simple IAM policy to allow a user to upload to an S3 bucket, locked down to their specific Cognito Identity
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::UserUploads/${cognito-identity.amazonaws.com:sub}/*"
@jeffski
jeffski / s3-upload-policy
Last active June 23, 2017 04:58
Simple IAM policy to allow a user to upload to an S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::UserUploads/*"
<?php
/**
* Assumes https://github.com/Spomky-Labs/jose library is installed and autoloading is set up
* Decode and verify token guide: https://github.com/Spomky-Labs/jose/blob/master/doc/operation/Verify.md
*/
use Jose\Factory\JWKFactory;
use Jose\Loader;
// We load the key set from a URL
// JSON Key URL (JKU) - https://cognito-idp.{region}.amazonaws.com/{userPoolId}/.well-known/jwks.json.
<html>
<head>
<title>Cognito Sign In Example</title>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/aws-cognito-sdk.min.js"></script>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/amazon-cognito-identity.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.32.0/aws-sdk.min.js"></script>
<script>
var CognitoUserPool = AmazonCognitoIdentity.CognitoUserPool;
var poolData = {
<html>
<head>
<title>Cognito Sign In Example</title>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/aws-cognito-sdk.min.js"></script>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/amazon-cognito-identity.min.js"></script>
<script>
var CognitoUserPool = AmazonCognitoIdentity.CognitoUserPool;
var poolData = {
UserPoolId : 'ap-southeast-2_EPyUfpQq7', // Your user pool id
<html>
<head>
<title>Cognito Sign Up Example</title>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/aws-cognito-sdk.min.js"></script>
<script src="https://rawgit.com/aws/amazon-cognito-identity-js/master/dist/amazon-cognito-identity.min.js"></script>
<script>
var CognitoUserPool = AmazonCognitoIdentity.CognitoUserPool;
var poolData = {
UserPoolId : 'ap-southeast-2_EPyUfpQq7', // Your user pool id
<html>
<head>
<title>Cognito Example</title>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/aws-sdk/2.32.0/aws-sdk.min.js"></script>
<script>
$(document).ready(function() {
// Load the Facebook SDK
$.getScript('//connect.facebook.net/en_US/sdk.js', function() {
FB.init({
@jeffski
jeffski / install-ffmpeg-amazon-linux.sh
Created December 14, 2015 10:09 — forked from gboudreau/install-ffmpeg-amazon-linux.sh
How to compile ffmpeg on Amazon Linux (EC2)
#!/bin/sh
# Based on instructions found here: http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat#FFMpegInstallationonCentOSandRedHat-InstallX264
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF