Skip to content

Instantly share code, notes, and snippets.

View brittanydionigi's full-sized avatar

Brittany Dionigi brittanydionigi

View GitHub Profile
@brittanydionigi
brittanydionigi / server.js
Last active July 6, 2017 15:20
Example: Node/Express server with JWT authentication for an endpoint
// =================================================================
// require all necessary packages =================================
// =================================================================
const express = require('express');
const cors = require('cors');
const app = express();
const jwt = require('jsonwebtoken');
@brittanydionigi
brittanydionigi / manifest.json
Created July 10, 2017 16:21
example manifest
{
"short_name": "FakeNews",
"name": "Fake News - Your #2 Source for Fake News",
"icons": [
{
"src": "img/logo-48x48.png",
"type": "image/png",
"sizes": "48x48"
},
{
@brittanydionigi
brittanydionigi / git.md
Last active July 12, 2017 15:34
backwards planning example
Git * Hooks * Branches * Remotes * Locals
@brittanydionigi
brittanydionigi / js-challenge-1.md
Created July 12, 2017 16:24
JS Challenge mod 4

Prompt

Extend the native Array data type to allow a groupBy method so that when given an array of objects, you can group each array item by a specified property.

For example, given an array of Turing students:

let students = [
  { name: "Louisa", module: "4FE", track: "frontEnd" },
  { name: "Nathaniel", module: "3FE", track: "frontEnd" },
@brittanydionigi
brittanydionigi / gcd.md
Created July 19, 2017 14:51
Greatest Common Denominator

Prompt

Using recursion, find the greatest common denominator of two positive integers.

For example,

greatestCommonDenominator(9, 12) #=> 3
@brittanydionigi
brittanydionigi / server.js
Last active August 22, 2017 13:01
Trains Express setup
// =================================================================
// require all necessary packages ==================================
// =================================================================
const express = require('express');
const app = express();
const bodyParser = require('body-parser');
const jwt = require('jsonwebtoken');
<!doctype html>
<html>
<head>
<title>Firebase Google Auth</title>
<style type="text/css">body,button,html{text-align:center}body,html{margin:50px;font-family:'Helvetica Neue'}button{border:0;background-color:pink;text-transform:uppercase;color:#fff;padding:15px 30px;margin:0 auto}#accountDetails{font-family:'Courier New';border:1px solid #eee;padding:20px;margin:20px auto;overflow-wrap:break-word}</style>
</head>
<body>
<button id="signIn">Sign In</button>
<div id="accountDetails"></div>

Read about Pascal's Triangle here

Pascal

Write a function that, given a depth (n), returns an array representing Pascal's Triangle to the n-th level.

For example:

pascalsTriangle(4) #=> [1, 1, 1, 1, 2, 1, 1, 3, 3, 1];

@brittanydionigi
brittanydionigi / .eslintrc
Last active September 16, 2017 18:01
Mod2 Eslint
{
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": [
"react"
],
"env": {
@brittanydionigi
brittanydionigi / .eslintrc
Last active April 18, 2018 13:47
Mod3 ESLint
{
"parser": "babel-eslint",
"extends": [
"eslint:recommended",
"plugin:react/recommended"
],
"plugins": [
"react"
],
"env": {