Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View desoga10's full-sized avatar
💥
Aiming for the stars

deji adesoga desoga10

💥
Aiming for the stars
View GitHub Profile
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { DataService } from './service/data.service';
interface Post {
userId: number;
id: number;
title: string;
body: string;
}
ngOnInit() {
this.service.cryptoData().subscribe((res) => {
this.result = res;
this.coinPrice = this.result.data.coins.map((coins: any) => coins.price);
this.coinName = this.result.data.coins.map((coins: any) => coins.name);
console.log(this.coinPrice);
console.log(this.coinName);
this.chart = new Chart('canvas', {
type: 'bar',
import { Component } from '@angular/core';
import Chart from 'chart.js/auto';
import { ChartService } from './service/chart.service';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css'],
})
export class AppComponent {
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/environments/environment';
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json',
'X-My-Custom-Header': `${environment.API_KEY}`,
'Access-Control-Allow-Origin': '*',
}),
@desoga10
desoga10 / mysql_cheat_sheet.md
Created December 26, 2021 22:13 — forked from bradtraversy/mysql_cheat_sheet.md
MySQL Cheat Sheet

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

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 September 8, 2021 22:11 — forked from gitdagray/online_offline_detection.js
Online / Offline Status Detection w/ Async & Await
/* ********** 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
```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);
/** @type {import("snowpack").SnowpackUserConfig } */
export default {
mount: {
/* ... */
public: '/',
src: '/dist'
},
plugins: [
/* ... */
],
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 />);