View db.json
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
{ | |
"authors": [ | |
{ | |
"name": "Chinua Achebe", | |
"id": 1 | |
}, | |
{ | |
"name": "Douglas Adams", | |
"id": 2 | |
}, |
View lexer.py
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
# -*- coding: utf-8 -*- | |
""" | |
pygments.lexers.jsx | |
~~~~~~~~~~~~~~~~~~~~ | |
Lexers for JSX formats. | |
Based on https://github.com/fcurella/jsx-lexer | |
""" | |
import re |
View init-letsencrypt.sh
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/bash | |
# Usage: | |
# $ chmod +x init-letsencrypt.sh | |
# $ init-letsencrypt.sh mydomain.com bob@email.com 1 | |
# | |
# Reference: | |
# https://medium.com/@pentacent/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71 | |
domain=${1} |
View seedData.js
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
// Usage (from `server` directory): | |
// $ node -r dotenv/config -r esm src/scripts/seedData.js <PASSWORD> | |
import faker from "faker"; | |
import gravatarUrl from "gravatar-url"; | |
import mongoose from "mongoose"; | |
import auth0 from "../config/auth0"; | |
import initMongoose from "../config/mongoose"; | |
import Post from "../models/Post"; |
View permutations.js
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
let someChars = ['A', 'B', 'C', 'D']; | |
/** | |
* Handle all permutations for one array item (in relation to all other array items) | |
*/ | |
function permutateAgainstOneItem(arr) { | |
let [first, ...tail] = arr; | |
let head = [first]; | |
let permutations = []; |
View data.js
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
const data = { | |
people: [ | |
{ | |
id: 1, | |
name: "Mark Hamill", | |
birthday: "September 25, 1951", | |
placeOfBirth: "Oakland, California, USA", | |
bio: | |
"Mark Hamill is best known for his portrayal of Luke Skywalker in the original Star Wars trilogy.", | |
filmography: [1] |
View dataFormatHelpers.js
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
// Helper to format GraphQL data into section list data | |
export const formatSessionData = sessions => { | |
return sessions | |
.reduce((acc, curr) => { | |
const timeExists = acc.find(section => section.title === curr.startTime); | |
timeExists | |
? timeExists.data.push(curr) | |
: acc.push({ title: curr.startTime, data: [curr] }); | |
return acc; | |
}, []) |
View styles.css
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
/* Account Login */ | |
/*-----------------------------------------*/ | |
.app-wrapper { | |
align-items: center; | |
display: flex; | |
justify-content: center; | |
height: 100vh; | |
} |
View App.css
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
/* To-Do List */ | |
/*-----------------------------------------*/ | |
#root { | |
display: flex; | |
justify-content: center; | |
height: 100vh; | |
} | |
.todo-list { |
View dploy.yaml
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
staging: | |
scheme: sftp | |
host: PROJECT-NAME.cp.academy.red | |
port: 22 | |
user: YOUR PROJECT NAME | |
pass: YOUR SFTP PASSWORD | |
check: true | |
include: | |
"themes/[YOUR-THEME-NAME]/build/**": "themes/[YOUR-THEME-NAME]/build/" | |
exclude: [ "README.md", ".gitignore", "themes/[YOUR-THEME-NAME]/.eslintrc", "themes/[YOUR-THEME-NAME]/gulpfile.js", "themes/[YOUR-THEME-NAME]/package.json", "themes/[YOUR-THEME-NAME]/package-lock.json", "themes/[YOUR-THEME-NAME]/js/**", "themes/[YOUR-THEME-NAME]/sass/**" ] |
NewerOlder