Skip to content

Instantly share code, notes, and snippets.

View patrick91's full-sized avatar
dealing with personal stuff, I might take a while to review things

Patrick Arminio patrick91

dealing with personal stuff, I might take a while to review things
View GitHub Profile
{
"swagger": "2.0",
"info": {
"version": "1.2.3",
"title": "Airport & City Search",
"x-status": "validated",
"x-tags": [
"#ama-for-dev"
],
"x-release-note": {
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 100%;
margin: 0;
width: 100%;
overflow: hidden;
}
@patrick91
patrick91 / friday-8-sept.md
Created September 8, 2017 09:02
Various links
resource "aws_api_gateway_method" "ResourceMethod" {
rest_api_id = "${var.rest_api_id}"
resource_id = "${var.resource_id}"
http_method = "${var.http_method}"
authorization = "${var.authorization}"
request_parameters = "${var.request_parameters}"
request_models = { "application/json" = "${var.request_model}" }
}
resource "aws_api_gateway_integration" "ResourceMethodIntegration" {
package main
import (
"fmt"
"html"
"log"
"net/http"
"github.com/dghubble/go-twitter/twitter"
"github.com/dghubble/oauth1"
import * as React from 'react';
import styled from 'styled-components';
import { ComponentClass, StatelessComponent } from 'react';
export type Component<P> = ComponentClass<P> | StatelessComponent<P>;
interface FooProps {
message: string,
primary: boolean,
};
for f in *.srt; do
t=$(echo $f | sed 's/\.mov.srt$//' | tr '[:upper:]' '[:lower:]');
echo converting $f to $t.vtt
srt-to-vtt $f > $t.vtt
sed -i -e 's/<[^>]*>//g' $t.vtt
done
import sys
import glob
def add_line(filename):
out = []
with open(filename) as f:
for l in f:
if '-->' in l:
@patrick91
patrick91 / config.go
Last active September 15, 2018 11:43 — forked from agtorre/config.go
Store OAuth2 Token Using Datastore
// Config is a custom oauth2 config that is used to store the token
// in the datastore
type Config struct {
*oauth2.Config
}
// StoreToken is called when exchanging the token and saves the token
// in the datastore
func (c *Config) StoreToken(ctx context.Context, token *oauth2.Token) error {
log.Infof(ctx, "storing the token")
aws iam upload-server-certificate \
--server-certificate-name MixTheCitySha2 \
--certificate-body file://mixthecity.com.crt \
--private-key file://mixthecity.com.plain.key \
--certificate-chain file://sub.class1.server.sha2.ca.pem \
--path /cloudfront/mix-the-city/