This file contains hidden or 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
| // DB DATA SOURCE | |
| /** START OF DB DATA SOURCE **/ | |
| const { DataSource } = require("apollo-datasource"); | |
| const sqlite = require("sqlite3"); | |
| const createDatabase = () => { | |
| return new Promise((resolve, reject) => { | |
| const db = new sqlite.Database(process.env.DB_FILE_PATH, (err) => { |
This file contains hidden or 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
| import { useState } from 'react'; | |
| export default function TodoList () { | |
| const [todo, setTodo] = useState('') | |
| const [todoList, setTodoList] = useState([]) | |
| const addTodo = () => { | |
| if(!todo) return | |
| setTodoList([...todoList, { text: todo, completed:false}]) | |
| setTodo('') |
This file contains hidden or 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
| function WordSplit(strArr) { | |
| const firstComparisonString = strArr[0] | |
| const dictionaryItems = strArr[1].split(',') | |
| let result = 'not possible' | |
| for (let i = 0; i <= firstComparisonString.length; i++) { | |
| const firstMatch = firstComparisonString.substring(0, i) | |
| const lastMatch = firstComparisonString.substring(i, firstComparisonString.length) | |
| if (dictionaryItems.includes(firstMatch) && dictionaryItems.includes(lastMatch)) { |
This file contains hidden or 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
| 'use strict'; | |
| process.stdin.resume(); | |
| process.stdin.setEncoding('utf-8'); | |
| let inputString = ''; | |
| let currentLine = 0; | |
| process.stdin.on('data', function(inputStdin) { | |
| inputString += inputStdin; |
This file contains hidden or 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
| set nocompatible " Disable vi-compatibility | |
| set t_Co=256 | |
| colorscheme xoria256 | |
| set guifont=menlo\ for\ powerline:h16 | |
| set guioptions-=T " Removes top toolbar | |
| set guioptions-=r " Removes right hand scroll bar | |
| set go-=L " Removes left hand scroll bar | |
| set linespace=15 |