Skip to content

Instantly share code, notes, and snippets.

Avatar
😸
Starting on git hub

Nelson edoves

😸
Starting on git hub
View GitHub Profile
View divisibleby3.js
Hello; Hello World; World
Write a function that takes an integer and:
If the number is a multiple of 3, return "Hello".
If the number is a multiple of 5, return "World".
If the number is a multiple of both 3 and 5, return "Hello World".
helloWorld(3) "Hello"
helloWorld(5) "World"
@edoves
edoves / Relational_Database.sql
Last active Jan 23, 2020
mysqlcommand, mysqlconnect php, mysqliconnectOOP version php
View Relational_Database.sql
-- 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' );
View index.html
<!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>
View git.bash
# 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
View todolist-and-function-jquery.js
{
"todoitem": [
{
"id": 1,
"item": "first todo",
"complete": true
},
{
"id": 2,
"item": "second todo",
View todolist-sample.json
{
"todolist": [
{
"id": 1,
"title": "first todo",
"description": "pick up milk",
"complete": true,
"canceled": true,
"date": 1389878466730
},
View express-jquery-ajax.js
// 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()
View express-vanillajs-ajax.js
/**
* ! ####### fetch data from http://localhost:3000/api #######
* ?
* TODO:
* @param
*/
async function updateFeedbackdata() {
const apiResponse = await fetch('api');
const data = await apiResponse.json();
return { data }
@edoves
edoves / reactaxiosadependecy.js
Last active Nov 12, 2019
Calling FetchAPI and Axios
View reactaxiosadependecy.js
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 Sep 15, 2019
Sample server Express
View app.js
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"));
You can’t perform that action at this time.