Skip to content

Instantly share code, notes, and snippets.

@CaptainChemist
CaptainChemist / cdk-stack.ts
Last active August 9, 2023 13:08
cdk-fargate-application-lb
import ec2 = require('@aws-cdk/aws-ec2');
import ecs = require('@aws-cdk/aws-ecs');
import ecs_patterns = require('@aws-cdk/aws-ecs-patterns');
import cdk = require('@aws-cdk/core');
import route53 = require('@aws-cdk/aws-route53');
import acm = require('@aws-cdk/aws-certificatemanager');
import targets = require('@aws-cdk/aws-route53-targets/lib');
import path = require('path');
import { config } from 'dotenv';
import { ApplicationProtocol, SslPolicy } from '@aws-cdk/aws-elasticloadbalancingv2';
// components/CreateRecipe.tsx
import { Form, Row, Col, Button } from 'antd';
import { submitForm } from '../utils/submitForm';
import { GenerateInput } from './GenerateFields';
export const CreateRecipe = () => {
const initiateCreateRecipe = () => {
console.log('submitted Form');
};
import * as _ from 'lodash';
import { QueryHookOptions, useQuery } from '@apollo/react-hooks';
import { recipesGraphQL } from '../graphql/queries/recipes';
import { userLikesGraphQL } from '../graphql/queries/userLikes';
import { Row } from 'antd';
import { Recipe } from '../generated/apollo-components';
export enum queryEnum {
userLikes = 'userLikes',
recipes = 'recipes',
@CaptainChemist
CaptainChemist / Dockerfile
Created July 3, 2018 14:10
DynamoDB testing with jest
FROM node:8
WORKDIR /app
COPY package.json package.json
USER root
RUN echo "deb http://http.debian.net/debian jessie-backports main" | \
tee --append /etc/apt/sources.list.d/jessie-backports.list > /dev/null && \
apt-get update -y && \
apt-get install -t jessie-backports openjdk-8-jdk -y && \
update-java-alternatives -s java-1.8.0-openjdk-amd64
context: async ({ event }) => {
const user = await authenticate(event.headers.Authorization);
return { db, user };
},
// This is what the authenticate.js file looks like
import jwksClient from 'jwks-rsa';
2018/01/09 17:54:08 [debug] 10524#10524: epoll add event: fd:8 op:1 ev:00002001
2018/01/09 17:54:26 [debug] 10524#10524: post event 000055D3DFDF6A40
2018/01/09 17:54:26 [debug] 10524#10524: delete posted event 000055D3DFDF6A40
2018/01/09 17:54:26 [debug] 10524#10524: accept on 0.0.0.0:80, ready: 0
2018/01/09 17:54:26 [debug] 10524#10524: posix_memalign: 000055D3DFDE31D0:512 @16
2018/01/09 17:54:26 [debug] 10524#10524: *1 accept: 172.31.000.000:4079 fd:9
2018/01/09 17:54:26 [debug] 10524#10524: *1 event timer add: 9: 180000:1515520646206
2018/01/09 17:54:26 [debug] 10524#10524: *1 reusable connection: 1
2018/01/09 17:54:26 [debug] 10524#10524: *1 epoll add event: fd:9 op:1 ev:80002001
2018/01/09 17:54:26 [debug] 10524#10524: *1 post event 000055D3DFDF6B00
2018/01/09 17:55:16 [debug] 10557#10557: epoll add event: fd:8 op:1 ev:00002001
2018/01/09 17:55:27 [debug] 10557#10557: post event 000055A779AE3A80
2018/01/09 17:55:27 [debug] 10557#10557: delete posted event 000055A779AE3A80
2018/01/09 17:55:27 [debug] 10557#10557: accept on 0.0.0.0:80, ready: 0
2018/01/09 17:55:27 [debug] 10557#10557: posix_memalign: 000055A779AD0210:512 @16
2018/01/09 17:55:27 [debug] 10557#10557: *1 accept: 172.31.000.000:4099 fd:9
2018/01/09 17:55:27 [debug] 10557#10557: *1 event timer add: 9: 180000:1515520707422
2018/01/09 17:55:27 [debug] 10557#10557: *1 reusable connection: 1
2018/01/09 17:55:27 [debug] 10557#10557: *1 epoll add event: fd:9 op:1 ev:80002001
2018/01/09 17:55:27 [debug] 10557#10557: *1 post event 000055A779AE3B40
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
#try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
@CaptainChemist
CaptainChemist / gist:ee9b9eee813111d43182
Created March 17, 2016 22:47
Problems making a reactive method call
Template.QuadLayout.onCreated(function(){
Session.set('nextQuestionId', this.data.questionId);
Session.set('nextCurrentLevel', this.data.currentLevel);
Tracker.autorun(function(){
var nextQuestionId = Session.get('nextQuestionId');
var nextCurrentLevel = Session.get('nextCurrentLevel');
Meteor.call('checkToCreateBlankQuad',nextQuestionId, nextCurrentLevel);
});
});