Skip to content

Instantly share code, notes, and snippets.

View taniarascia's full-sized avatar
💾

Tania Rascia taniarascia

💾
View GitHub Profile
@taniarascia
taniarascia / simple-grid.less
Created December 10, 2015 16:16
Repeating Grid
.grid {
list-style: none;
padding: 0;
margin: 0;
&:after {
display: table;
content: '';
clear: both;
}
}
@taniarascia
taniarascia / margins.scss
Created January 8, 2016 01:12
Add margins in between columns
/* Adding margins instead of padding based
.no-collapse {
> [class*="column"] ~ [class*="column"] {
margin-left: .5rem;
}
}
[class*="column"] ~ [class*="column"] {
margin-left: 0;
}
@include large-screen {
@taniarascia
taniarascia / triangle.css
Created February 6, 2018 04:09
Triangle
i {
border: solid black;
border-width: 0 3px 3px 0;
display: inline-block;
padding: 3px;
transform: rotate(45deg);
}

Build a REST API With Node.js and Express: Connecting a Database

In Part 1: Understanding RESTful APIs, we learned what the REST architecture is, what HTTP request methods and responses are, and how to understand a RESTful API endpoint. In Part 2: How to Set Up an Express API Server, we learned how to build servers with both Node's built in http module and the Express framework, and how to route the app we created to different URL endpoints.

Currently, we're using static data to display user information in the form of a JSON feed when the API endpoint is hit with a GET request. In this tutorial, we're going to set up a MySQL database to store all the data, connect to the database from our Node.js app, and allow the API to use the GET, POST, PUT, and DELETE methods to create a complete API.

Installation

Up to this point, we have not used a database to store or manipulate any data, so we're going to set one up. This tutorial will be using MySQL, and if you already have MySQL insta

@taniarascia
taniarascia / .prettierrc
Created September 11, 2018 19:05
Prettier
{
"semi": false,
"printWidth": 100,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"bracketSpacing": true
}
@taniarascia
taniarascia / pandoc.md
Created September 23, 2018 03:45
Pandoc

Pandoc Resources

brew instal pandoc
mkdir pandocking
cd pandocking
pandoc chapter1.md -s -o chapter1.html

Flags

@taniarascia
taniarascia / roadmap.md
Created September 23, 2018 03:58
Roadmap

Roadmap of Web Development

Getting Started

Operating System

What operating system your computer runs on.

  • Mac, Windows, Linux
@taniarascia
taniarascia / keybase.md
Created December 22, 2018 21:24
Keybase

Keybase proof

I hereby claim:

  • I am taniarascia on github.
  • I am taniarascia (https://keybase.io/taniarascia) on keybase.
  • I have a public key whose fingerprint is 2389 41F6 BA1D 7BE2 119E 973D 8345 A0A6 86E5 7E04

To claim this, I am signing this object:

@taniarascia
taniarascia / 16.js
Created January 1, 2019 00:57
16-bit
// echo -en "\x01\x02\x03\x04\x05\x06hello world\x07\x08\x09\x10goodbye world\x11\x12\x13\x14\x15" > data
let fs = require('fs')
let file = process.argv.slice(2)[0]
let buffer = fs.readFileSync(file)
let lines = []
for (let i = 0; i < buffer.length; i += 16) {
let block = buffer.slice(i, i + 16)
@taniarascia
taniarascia / new-moon.itermcolors
Created February 28, 2019 12:07
new-moon.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.77254903316497803</real>