Skip to content

Instantly share code, notes, and snippets.

@edoves
edoves / Relational_Database.sql
Last active September 4, 2022 02:35
mysqlcommand, mysqlconnect php, mysqliconnectOOP version php
-- 02 JOIN
-- test.db
-- join example tables, left and right
CREATE TABLE left ( id INTEGER, description TEXT );
CREATE TABLE right ( id INTEGER, description TEXT );
INSERT INTO left VALUES ( 1, 'left 01' );
INSERT INTO left VALUES ( 2, 'left 02' );
INSERT INTO left VALUES ( 3, 'left 03' );
npm i react react-dom
npm i -D @babel/core @babel/preset-env @babel/preset-react webpack webpac-cli webpack-dev-server babel-loader css-loader style-loader html-webpack-plugin
@edoves
edoves / app.js
Last active September 15, 2019 02:54
Sample server Express
const express = require("express");
const app = express();
// logger
const morgan = require("morgan");
const productRoutes = require("./api/routes/products");
const orderRoutes = require("./api/routes/orders");
// using the morgan the resul will beo nthe terminal
app.use(morgan("dev"));
@edoves
edoves / reactaxiosadependecy.js
Last active November 12, 2019 07:51
Calling FetchAPI and Axios
import React, { Component } from "react";
import axios from "axios";
import "./App.css";
import { recipes } from "./tempList";
import { AUTH_KEY } from "./config";
import RecipeList from "./components/RecipeList";
import RecipeDetails from "./components/RecipeDetails";
class App extends Component {
state = {
@edoves
edoves / git.bash
Last active December 7, 2019 12:36
# From Kal Skills Teaching procces on cloning a existing repository or want to colaborate with it
git clone - clone a repository
cd - change directory
ls - list directory
git status - mostly for verification
git add filename
git commit -m "waht ever message here"
git push
upstream
// Jquery Version
$(function () {
$.getJSON('api', updateFeedback);
$('.feedback-form').submit(function (e) {
e.preventDefault();
$.post('api', {
name: $('#feedback-form-name').val(),
title: $('#feedback-form-title').val(),
message: $('#feedback-form-message').val()
/**
* ! ####### fetch data from http://localhost:3000/api #######
* ?
* TODO:
* @param
*/
async function updateFeedbackdata() {
const apiResponse = await fetch('api');
const data = await apiResponse.json();
return { data }
{
"todolist": [
{
"id": 1,
"title": "first todo",
"description": "pick up milk",
"complete": true,
"canceled": true,
"date": 1389878466730
},
{
"todoitem": [
{
"id": 1,
"item": "first todo",
"complete": true
},
{
"id": 2,
"item": "second todo",
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>