Skip to content

Instantly share code, notes, and snippets.

View sandygudie's full-sized avatar

Goodnews Sandy sandygudie

View GitHub Profile
{
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"env": {
import React from "react";
import { render, screen } from "@testing-library/react";
import Counter from "../Counter";
import userEvent from "@testing-library/user-event";
describe("Counter function", () => {
test("button clicked to increase or decrease counter", () => {
render(<Counter />);
const increment = screen.getByRole("button", { name: /Increase/i });
# This is a basic workflow to help you get started with Actions
name: CI-CD
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
@sandygudie
sandygudie / Dockerfile
Created October 29, 2021 12:52
GitHub Actions
FROM node:14-alpine AS development
ENV NODE_ENV development
# Add a work directory
WORKDIR /app
# Cache and Install dependencies
COPY package.json .
COPY package-lock.json .
RUN npm install
# Copy app files
COPY . .
@sandygudie
sandygudie / Dockerfile
Created January 29, 2021 09:53
SCA-cloud-docker
FROM node:14
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
@sandygudie
sandygudie / index.html
Created January 29, 2021 09:29
SCA-cloud-docker
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>webpage</title>
</head>
<body>
<h1 style="width:50%; margin: 4em auto">Welcome to SCA Cloud School Application
@sandygudie
sandygudie / App.js
Created January 29, 2021 09:21
SCA-cloud-docker
const express = require("express");
const app = express();
const router = express.Router();
const path = __dirname + "/views/";
const port = 8080;
router.get("/", function (req, res) {
res.sendFile(path + "index.html");
});
import React from "react";
const Colorbox = ({ color }) => {
let containerStyle = {
backgroundColor: color,
};
return <div className="colorbox" style={containerStyle}></div>;
};
export default Colorbox;
@sandygudie
sandygudie / QuoteBox.js
Created January 21, 2021 23:29
Quote generator
import React from "react";
const QuoteBox = ({ data, onclick, tweet }) => {
let quoteStyle = {
backgroundColor: "white",
outline: data.color,
};
let Style = {
color: data.color,
fontSize: "20px",
@sandygudie
sandygudie / App.js
Last active January 21, 2021 23:37
quote generator
import React, { Component } from "react";
import Colorbox from "../Component/Colorbox";
import QuoteBox from "../Component/QuoteBox";
import "./App.css";
class App extends Component {
constructor() {
super();
this.state = {
color: "green",