This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var k = 0; k < 5; k++) { | |
console.log(k); // 0, 1, 2, 3, 4 | |
} | |
console.log(k); //5 because k is global |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Hello World!</title> | |
</head> | |
<body> | |
<main id="app"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::collections::HashMap; | |
fn mean(numbers: &Vec<i32>) -> f32 { | |
let sum: i32 = numbers.iter().sum(); | |
sum as f32 / numbers.len() as f32 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tutorial: https://freshman.tech/golang-timer/ | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"os" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install express cors body-parser dotenv stream-chat --save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// .env | |
STREAM_API_KEY=<your api key> | |
STREAM_APP_SECRET=<your app secret> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('dotenv').config(); | |
const express = require('express'); | |
const cors = require('cors'); | |
const bodyParser = require('body-parser'); | |
const { StreamChat } = require('stream-chat'); | |
const app = express(); | |
app.use(cors()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install @auth0/auth0-spa-js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useContext } from 'react'; | |
import createAuth0Client from '@auth0/auth0-spa-js'; | |
const DEFAULT_REDIRECT_CALLBACK = () => | |
window.history.replaceState({}, document.title, window.location.pathname); | |
export const Auth0Context = React.createContext(); | |
export const useAuth0 = () => useContext(Auth0Context); | |
export const Auth0Provider = ({ | |
children, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
import { Auth0Provider } from './auth0'; | |
ReactDOM.render( | |
<Auth0Provider | |
domain={"<your domain>"} | |
client_id={"<your client id>"} |
OlderNewer