This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "log" | |
| "net/http" | |
| "github.com/google/uuid" | |
| "github.com/gorilla/mux" | |
| ) |
This file contains hidden or 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
| const array = [2, 100, 4, 5, 7, 21, 13]; | |
| const bubbleSortInPlace0 = (arr) => { | |
| for (let i = 0; i < arr.length - 1; i++) { | |
| for (let j = 0; j < arr.length - 1 - i; j++) { | |
| if (arr[j] > arr[j+1]) { | |
| [arr[j], arr[j+1]] = [arr[j+1], arr[j]] | |
| }; | |
| }; | |
| }; |
This file contains hidden or 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
| const express = require('express'); | |
| const app = express(); | |
| const router = express.Router(); | |
| app.use(express.json()); | |
| app.use(express.urlencoded({ extended: false })); | |
| const sendHi = async (req, res) => { | |
| res.status(200).send("Hi").end(); | |
| }; |
This file contains hidden or 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
| const express = require('express'); | |
| const axios = require('axios'); | |
| const redis = require('redis'); | |
| const cors = require('cors'); | |
| const PORT = 8000; | |
| const DEFAULT_EXPIRATION = 3600; | |
| const API_URL = "https://jsonplaceholder.typicode.com/photos" | |
| const app = express(); |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "encoding/json" | |
| "log" | |
| "net/http" | |
| "github.com/google/uuid" | |
| "github.com/gorilla/mux" |
This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "os" | |
| "time" |
This file contains hidden or 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
| package main | |
| import ( | |
| "container/heap" | |
| "fmt" | |
| "github.com/holiman/uint256" | |
| ) | |
| // An Item is something we manage in a priority queue. |
This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "errors" | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "sync" | |
| "syscall" |
This file contains hidden or 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
| #![allow(dead_code)] | |
| use std::fmt; | |
| // Tuple struct | |
| struct RGBColor(u8, u8, u8); | |
| // Manually implementing std::fmt::Debug | |
| impl fmt::Debug for RGBColor { | |
| fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { | |
| f.debug_struct("RGBColor") // Must be exactly "RGBColor" in this case |
This file contains hidden or 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
| #![allow(dead_code)] | |
| use std::fmt; | |
| enum OrderStatus { | |
| Null, | |
| Created, | |
| Cancelled, | |
| Successful, | |
| } |