Skip to content

Instantly share code, notes, and snippets.

View bmordan's full-sized avatar
💭
At the command line

Bernard Mordan bmordan

💭
At the command line
View GitHub Profile
@bmordan
bmordan / tic-tac-toe.js
Created September 28, 2022 06:45
A simple javascript tic tac toe CLI game
const readline = require('readline')
const rl = readline.createInterface(process.stdin, process.stdout)
let board = "123456789"
let player = "X"
displayBoard()
function prompt () {
@bmordan
bmordan / index.html
Last active September 28, 2022 22:28
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tic Tac Toe</title>
<style>
body {
height: 100vh;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/css/tachyons.min.css" />
<title>Plantstore</title>
<style>
[
{
"id": 1,
"name": "Boston Fern",
"image": "https://github.com/MultiverseLearningProducts/swe-solutions/blob/main/swe2/mod1/shared/images/boston_fern_sm.jpg?raw=true",
"description": "Nephrolepis exaltata, known as the sword fern or Boston fern, is a species of fern in the family Lomariopsidaceae native to tropical regions throughout the world.",
"tag": "shade loving",
"price": 13.95
},
{
@bmordan
bmordan / id_rsa.pub
Created December 10, 2021 17:45
My Public SSH Key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDr66b70KqBJ4osbIhuXRLgPOZnh4eU9eX9ybu1n5gu7K/4rVFPmn4BC9K+sDPkB/YXIdZR7DCF8V3DixaMy1VogYB448Y8eojAa7A7DzbsctED9H5iGY5cgjzN/tYeViJpIQSVQIIfKs+AqJQhiO4gygSufdNJ4eLA1K4yEvFARxgm661eTpwaVDX8WjruwnIoDus+aYkxo+78Iw8GKK8wqGsWhOY+X4u9daT50Avt5n4BeTIY053H38Kqlc82JOso6U4lcDR6H9ZBV3Nhene4JyLy+NOfNyvJ5804Y//qH4Ctz/SEnnhJ/s5VHQdJgbFj2GaaS13kuVqRN0rSxQUyFQENIIq7VpcEIFlZ87BAHXxpe3aUewjRw3mAsYIao6LXNftnlIUsBWvnWCOKtM4HXp4fVEbNlwY0zThIiCzgUHRcvqTRoWjBtQ2fe53kkmn8GtkQXsQ7AVeAyPED26qpNZBu6OpREGgVdwf3ONUZInkR40NzjguM/tL3q2YcwsOn7etFyS/cv9uXdYeaSzuegL8BF4pWnnw1zMEhn9jgjTNF9VD2L2BRXPyC/w1WO8CaYRByWi0M7QsWr6zW+O3WaaLbEmAND710M/TuIiUhphVwiuZcwkUh2EdAepjdwVZbiSFQBKS38oMPkOQmWXiFHvEhQcX0ncpCOzu461h8XQ== [email protected]
@bmordan
bmordan / 2009-demo-auth.txt
Last active November 17, 2021 10:23
Firebase Auth
import React, { useState, useEffect } from 'react'
import './firebase'
import { getAuth, signInWithPopup, GithubAuthProvider, signOut } from 'firebase/auth'
export default function App() {
const [user, setUser] = useState(true)
useEffect(() => {
const github = new GithubAuthProvider()
const auth = getAuth()
@bmordan
bmordan / create_glusterFS_volumes_in_a_swarm.yml
Created October 28, 2021 14:26
GlusterFS format an external volume
#### Create the disk spaces (optional)
* `sudo fdisk /dev/sdb` n p 1 w
* `sudo mkfs.ext4 /dev/sdb1`
* `sudo mkdir /glusterfs`
* `sudo mount /dev/sdb1 /glusterfs`
* add `/dev/sdb1 /glusterfs ext4 defaults 0 0` to `/etc/fstab`
@bmordan
bmordan / Mod_3_UML_SWE_Delivery_Generator.plantuml
Created June 2, 2021 12:29
Mod_3_UML_SWE_Delivery_Generator.plantuml
@startgantt
Project starts the 4th October 2021
saturday are closed
sunday are closed
-- SWE(OPEN)5 Module 3 --
[prework: Stages of the SDLC] lasts 3 days
[Deployment and communication in the SDLC] lasts 2 days and starts at [prework: Stages of the SDLC]'s end and is colored in Coral
[prework: roles and communication] starts at [Deployment and communication in the SDLC]'s end and lasts 14 days
[7 Principles of testing] lasts 1 day and starts at [prework: roles and communication]'s end and is colored in Coral
<!DOCTYPE html><html style="font-size: 10px;font-family: Roboto, Arial, sans-serif;" lang="en-GB"><head><script nonce="i5VeD3InhHHWbfuEWkaz6w">var ytcfg={d:function(){return window.yt&&yt.config_||ytcfg.data_||(ytcfg.data_={})},get:function(k,o){return k in ytcfg.d()?ytcfg.d()[k]:o},set:function(){var a=arguments;if(a.length>1)ytcfg.d()[a[0]]=a[1];else for(var k in a[0])ytcfg.d()[k]=a[0][k]}};
window.ytcfg.set('EMERGENCY_BASE_URL', '\/error_204?t\x3djserror\x26level\x3dERROR\x26client.name\x3d1\x26client.version\x3d2.20201220.08.00');</script><script nonce="i5VeD3InhHHWbfuEWkaz6w">(function(){window.yterr=window.yterr||true;window.unhandledErrorMessages={};window.unhandledErrorCount=0;
window.onerror=function(msg,url,line,columnNumber,error){var err;if(error)err=error;else{err=new Error;err.stack="";err.message=msg;err.fileName=url;err.lineNumber=line;if(!isNaN(columnNumber))err["columnNumber"]=columnNumber}var message=String(err.message);if(!err.message||message in window.unhandledErrorMessages||window.unhan
@bmordan
bmordan / seed.js
Created October 6, 2020 07:26
Seed data for a Restaurants app
const { Restaurant, Menu, Item, sequelize } = require('./models')
const data = [
{
"name": "Bayroot",
"image": "https://www.telegraph.co.uk/content/dam/Travel/Destinations/Europe/England/Brighton/brighton-restaurants-hotel-du-vin-bistro.jpg",
"menus": [
{
"title": "Grill",
"items": [
{