- Machine Learning cheatsheet: https://stanford.edu/~shervine/teaching/cs-229.html
- Pattern Recognition and Machine Learning Book
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Required Node.js modules */ | |
const Express = require('express'); | |
const Joi = require('joi') | |
const joiMiddleware = require('express-joi-validation').createValidator({}) | |
const Prisma = require('prisma/prisma-client'); | |
/** Instantiate Prisma client */ | |
const prisma = new Prisma.PrismaClient(); | |
/** Supplier validation schema for Joi */ | |
const supplierSchema = Joi.object({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultdb=> SELECT * FROM pg_available_extensions; | |
name | default_version | installed_version | comment | |
------------------------------+-----------------+-------------------+--------------------------------------------------------------------------------------------------------------------- | |
aiven_extras | 1.0.2 | | aiven_extras | |
plpgsql | 1.0 | 1.0 | PL/pgSQL procedural language | |
btree_gist | 1.5 | | support for indexing common datatypes in GiST | |
tcn | 1.0 | | Triggered change notifications | |
seg | 1.3 | | data type for representing line segments or floating-point intervals | |
pgrowlocks | 1.2 | |
Template that will create the following:
- API Gateway:
- Deployed as a
REGIONAL
endpoint. - Single root method, accepting
POST
requests only, with Lambda proxy integration to a target function.
- Deployed as a
- In-line Python Lambda function echoing back requesting users IP address to API Gateway requests:
- IAM role for Lambda allowing CloudWatch logs access.
- Permissions for Lambda that allow API Gateway endpoint to successfully invoke function.
Github repo for the Course: Stanford Machine Learning (Coursera)
Consider the problem of predicting how well a student does in her second year of college/university, given how well she did in her first year.
Specifically, let x be equal to the number of "A" grades (including A-. A and A+ grades) that a student receives in their first year of college (freshmen year). We would like to predict the value of y, which we define as the number of "A" grades they get in their second year (sophomore year).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DROP FUNCTION IF EXISTS fn_remove_accents; | |
DELIMITER | | |
CREATE FUNCTION fn_remove_accents( textvalue VARCHAR(10000) ) RETURNS VARCHAR(10000) | |
BEGIN | |
SET @textvalue = textvalue COLLATE utf8_general_ci;; | |
-- ACCENTS | |
SET @withaccents = 'ŠšŽžÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝŸÞàáâãäåæçèéêëìíîïñòóôõöøùúûüýÿþƒ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script will automatically sync all updates from one database to another. It is meant to be run while | |
* syncing the database using mongodump and mongorestore. | |
* | |
* Example: | |
* node livesync.js mongodb://<user>:<pass>@dbhost.com:10645/app-production \ | |
* mongodb://<user>:<pass>@dbhost.com:10499/local?authSource=app-production \ | |
* app-production \ | |
* mongodb://<user>:<pass>@newdbhost.com/app-prod | |
*/ |
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
- No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
- VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
- VPC with NAT, The best of both worlds, AWS services and web.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Make sure to: | |
# 1) Name this file `backup.sh` and place it in /home/ubuntu | |
# 2) Run sudo apt-get install awscli to install the AWSCLI | |
# 3) Run aws configure (enter s3-authorized IAM user and specify region) | |
# 4) Fill in DB host + name | |
# 5) Create S3 bucket for the backups and fill it in below (set a lifecycle rule to expire files older than X days in the bucket) | |
# 6) Run chmod +x backup.sh | |
# 7) Test it out via ./backup.sh |
NewerOlder