Skip to content

Instantly share code, notes, and snippets.

@Chojiu15
Chojiu15 / sol
Created September 15, 2021 22:26
smartcontract
// SPDX-License-Identifier: GPL-3.0
/**
*ME
*
* 10,000 Lunalanders flying through the Metaverse.
*/
pragma solidity ^0.8.0;
@Chojiu15
Chojiu15 / md
Created September 7, 2021 14:15
SQLexercises
EX 1
​Create a table named friends with three columns:
id that stores INTEGER
name that stores TEXT
birthday that stores DATE
Beneath your current code, add Jane Doe to friends.
Her birthday is May 30th, 1990.
Add two of your friends to the table.
@Chojiu15
Chojiu15 / ReactState.jsx
Last active August 19, 2021 11:53
React state
import{ useState, useEffect } from 'react'
import './App.css'
import Counter from './Counter.jsx'
const App = () => {
const [name, setName] = useState('')
const [count, setCount] = useState(0)
const [condition, setCondition] = useState(false)
// const myFunction = (a, b) => {
// if(a > b){
// return a
// }
// else if(b > a){
<!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>Document</title>
<link rel="stylesheet" href="../">
</head>
<body>
@Chojiu15
Chojiu15 / .js
Created May 14, 2021 12:38
SuperHeroesApi
const superHeroesRouter = require('express').Router()
superHeroesRouter.use(require('express').json())
const superHeroes = [
{ id: 1, name: "Batman" },
{ id: 2, name: "Spiderman" },
{ id: 3, name: "BlackPanther" },
];
superHeroesRouter.get("/", (req, res) => {
@Chojiu15
Chojiu15 / app
Created April 26, 2021 13:46
client
import React, {useState, useEffect} from "react";
import "./App.css";
import {client} from './client'
import axios from 'axios'
const App = () => {
const [articles, setArticles] = useState([])
useEffect(() => {
@Chojiu15
Chojiu15 / js
Created April 20, 2021 12:10
apiFetch1
import logo from './logo.svg';
import './App.css';
import Axios from 'axios'
import React, { useEffect, useState } from 'react';
function App() {
const [data, setData] = useState([])
const [search, setSearch] = useState('')
const [query, setQuery] = useState('')
@Chojiu15
Chojiu15 / .js
Created April 8, 2021 16:17
Cat OOP
// // Create an object that represents a cat. It should have properties for tiredness, hunger, loneliness and happiness
// // Next, write methods that increase and decrease those properties. Call them something that actually represents what would increase or decrease these things,
// like "feed", "sleep", or "pet".
// // Last, write a method that prints out the cat's status in each area. (Be creative e.g. Paws is really hungry, Paws is VERY happy.)
// // Bonus: Make the functions take arguments that increase or decrease arbitrary amounts
// // Bonus: Make the functions as arbitrary (or crazy) as cats are - sometimes make it so the cat doesn't want to be
@Chojiu15
Chojiu15 / E-commerce APP
Last active December 8, 2020 08:46
Christmas APP
## Proposal #2 - Dojo project (bdd/back/front)
You now know your projects better than we do and you should have a valid bdd model. For this dojo, focus on creating 2 or 3 tables linked by joins.
> E.g. An e-commerce platform containing users (name, first name, email) which have a list of products (name, category, price) in their shopping cart.
1. Database creation (Only selected tables)
2. Node project initialisation (express/mysql) or use of resources provided by the instructor
3. MySQL configuration
4. Creation of express routes