Skip to content

Instantly share code, notes, and snippets.

Avatar
💥
Aiming for the stars

deji adesoga desoga10

💥
Aiming for the stars
View GitHub Profile
View mysql_cheat_sheet.md

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

View app.yaml
runtime: python27
api_version: 1
threadsafe: true
handlers:
- url: /
static_files: dist/[project-name]/index.html
upload: dist/[project-name]/index.html
- url: /
static_dir: dist/[project-name]
skip_files:
@desoga10
desoga10 / online_offline_detection.js
Created Sep 8, 2021 — forked from gitdagray/online_offline_detection.js
Online / Offline Status Detection w/ Async & Await
View online_offline_detection.js
/* ********** Online / Offline Detection ********** */
// Request a small image at an interval to determine status
// ** Get a 1x1 pixel image here: http://www.1x1px.me/
// ** Use this code with an HTML element with id="status"
const checkOnlineStatus = async () => {
try {
const online = await fetch("/1pixel.png");
return online.status >= 200 && online.status < 300; // either true or false
View index.java
```java
import java.util.Scanner;
public class HelloWorld {
public static void main(String[] args) {
// Creates a reader instance which takes
// input from standard input - keyboard
Scanner reader = new Scanner(System.in);
View snowpack.config.mjs
/** @type {import("snowpack").SnowpackUserConfig } */
export default {
mount: {
/* ... */
public: '/',
src: '/dist'
},
plugins: [
/* ... */
],
View index.jsx
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
const rootElement = document.getElementById("root");
const root = ReactDOM.createRoot(rootElement);
root.render(<App />);
View app.jsx
import React from "react";
function App() {
return (
<div>
<header>
<img
src="https://res.cloudinary.com/dz4tt9omp/image/upload/v1625528354/react.png"
alt="logo"
/>
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Starter Snowpack App" />
<link rel="stylesheet" type="text/css" href="/index.css" />
<title>Starter Snowpack App</title>
</head>
View app.js
let modal = document.querySelector(".modal");
let show = document.querySelector(".show");
let closeButton = document.querySelector(".close-button");
function toggleModal() {
modal.classList.toggle("show-modal");
}
function windowOnClick(event) {
if (event.target === modal) {
View style.css
.btn{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: pink;
font-size: 20px;
color: white;
padding: 10px 30px;
cursor: pointer;