Skip to content

Instantly share code, notes, and snippets.

View ricklopez's full-sized avatar

Rick Lopez ricklopez

View GitHub Profile
@ricklopez
ricklopez / serverless.yml
Created April 7, 2021 02:49 — forked from DavidWells/serverless.yml
DynamoDB custom index serverless.yml example
service: service-name
provider:
name: aws
runtime: nodejs6.10
functions:
myfunc:
handler: handler.myfunc

Read (GET)

function getAllContacts(){
  fetch('https://5f217bf8daa42f0016665c89.mockapi.io/api/v1/contacts')
  .then(resp => resp.json())
  .then(renderToys)
}

Create (POST)

handleUser = (e) => {
e.preventDefault();
const user = e.target['user-input'].value;
fetch(`${config.API_ENDPOINT}/reviews/${user}`)
.then((res) => {
if (!res.ok) return res.json().then((e) => Promise.reject(e));
return res.json();
})
.then((data) => {
if(data.length < 1){
@ricklopez
ricklopez / napkin-one.md
Last active July 16, 2020 02:28 — forked from RandyWritesCode/napkin-design.md
"back of napkin" designs of the basic layout of my Punisher Season Two Trivia - Quiz App

Add and Image

![Title](https://user-images.githubusercontent.com/58892815/87619469-44f86d80-c6ea-11ea-9e30-7439299774bd.jpg)

Title

@ricklopez
ricklopez / napkin-one
Created July 16, 2020 02:27 — forked from RandyWritesCode/napkin-design.md
"back of napkin" designs of the basic layout of my Punisher Season Two Trivia - Quiz App
@ricklopez
ricklopez / flexbox.md
Last active March 19, 2020 01:55 — forked from spoike/flexbox.md
Flexbox CSS Cheatsheet

Flexbox Cheatsheet

Flex Container

default to row.

@ricklopez
ricklopez / docker-builder.sh
Created February 21, 2020 22:31 — forked from didip/docker-builder.sh
Small helper script that automates Docker building and pushing
#!/bin/bash
set -ex
PARENT_DIR=$(basename "${PWD%/*}")
CURRENT_DIR="${PWD##*/}"
IMAGE_NAME="$PARENT_DIR/$CURRENT_DIR"
TAG="${1}"
REGISTRY="hub.docker.com"
@ricklopez
ricklopez / fetch-api-examples.md
Created February 21, 2020 02:58 — forked from justsml/fetch-api-examples.md
JavaScript Fetch API Examples
@ricklopez
ricklopez / Knex-Setup.md
Created December 14, 2019 00:08 — forked from NigelEarle/Knex-Setup.md
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@ricklopez
ricklopez / Knex-Setup.md
Created December 14, 2019 00:08 — forked from NigelEarle/Knex-Setup.md
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init