Skip to content

Instantly share code, notes, and snippets.

{
"todoitem": [
{
"id": 1,
"item": "first todo",
"complete": true
},
{
"id": 2,
"item": "second todo",
{
"todolist": [
{
"id": 1,
"title": "first todo",
"description": "pick up milk",
"complete": true,
"canceled": true,
"date": 1389878466730
},
/**
* ! ####### fetch data from http://localhost:3000/api #######
* ?
* TODO:
* @param
*/
async function updateFeedbackdata() {
const apiResponse = await fetch('api');
const data = await apiResponse.json();
return { data }
// 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()
@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
@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 / 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"));
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 / 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' );