Skip to content

Instantly share code, notes, and snippets.

@admhpr
admhpr / serverless.yml
Last active July 28, 2020 07:16
S3 -> SNS topic
Resources:
# ===================== SNS =====================
DataframeCreatedSnsTopic:
Type: AWS::SNS::Topic
Properties:
DisplayName: "Topic to notify functions of dataframe creation"
TopicName: DataframeCreatedSnsTopic
# ===================== SNS Policy =====================
DataframeCreatedSnsTopic:
Type: AWS::SNS::TopicPolicy
@admhpr
admhpr / query
Created March 31, 2020 14:01
Practical Plants
http https://practicalplants.org/w/api.php\?format\=json\&action\=ask\&query\=%5B%5BCategory%3APlant%5D%5D%5B%5BHas%20primary%20image%3A%3A%2B%5D%5D%5B%5BShow%20on%20main%20page%20search%3A%3A%2B%5D%5D%7C%3FHas%20image%7C%3FHas%20common%20name%7C%3FHas%20shade%20tolerance%7C%3FHas%20sun%20preference%7C%3FHas%20water%20requirements%7C%3FHas%20hardiness%20zone%7C%3FHas%20heat%20zone\|limit%3D9 | jq ".query.results"
AWS.config.getCredentials(function(err) {
if (err) console.log(err.stack);
// credentials not loaded
else {
console.log("Access key:", AWS.config.credentials.accessKeyId);
console.log("Secret access key:", AWS.config.credentials.secretAccessKey);
}
});
@admhpr
admhpr / jsdayie19.md
Last active September 23, 2019 16:43

image

@admhpr
admhpr / server.conf
Created September 2, 2019 20:31
location blocks
server {
listen 80;
set $root /var/www;
server_name localhost;
location = / {
alias $root/app1/;
try_files $uri /index.html;
}
location ^~ /app1 {
@admhpr
admhpr / design_docke_template.md
Created June 5, 2019 07:25
Design Doc Template

Design Doc Title

Stakeholders

List stakeholders for project/feature.

Role Person
Dev Owner
Other Dev 1 (Engine)
@admhpr
admhpr / nginx.conf
Created June 4, 2019 08:24 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@admhpr
admhpr / README-Template.md
Created April 28, 2019 14:33 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@admhpr
admhpr / Mailer.js
Created March 28, 2019 02:08
Fix for lecture 139
const keys = require('../config/keys');
const sgMail = require('@sendgrid/mail');
class Mailer {
constructor({ subject, recipients }, content) {
sgMail.setApiKey(keys.sendGridKey);
this.to = recipients.map(({ email }) => email);
this.from = 'no-reply@emaily.com';
this.subject = subject;
this.html = content;
@admhpr
admhpr / PEDAC.md
Created March 11, 2019 20:05 — forked from LSStaff/PEDAC.md

PEDAC

Objective Step Description
Process the Problem Understand the Problem
  • Identify expected input and output
  • Make the requirements explicit
  • Identify rules
  • Mental model of the problem (optional)
Examples/Test Case Validate understanding of the problem
Data Structure How we represent data that we will work with when converting the input to output.
Algorithm Steps for converting input to output
Code with Intent Code Implementation of Algorithm