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 { Mutex, Semaphore } from 'async-mutex'; | |
import material from 'materialize-css/dist/js/materialize'; | |
let count = 0; | |
let clientLock = new Mutex(); | |
let clientSempahore = new Semaphore(2); | |
// Server Simulation | |
function processCommand() { | |
count += 1; |
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 { Mutex } from 'async-mutex'; | |
import material from 'materialize-css/dist/js/materialize'; | |
let count = 0; | |
let clientLock = new Mutex(); | |
// Server Simulation | |
function processCommand() { | |
count += 1; | |
return count; |
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 material from 'materialize-css/dist/js/materialize'; | |
let count = 0; | |
// Server simulation | |
async function processCommand() { | |
count += 1; | |
return count; | |
} |
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> | |
<header> | |
<title>I'm a trusted page</title> | |
</header> | |
<!-- Immediately dispatch the forum when we load--> | |
<body onload="document.hackform.submit()"> | |
<!-- Nothing suspicious... show the user a happy cat! --> |
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
service: FortuneCookie | |
provider: | |
name: aws | |
runtime: nodejs12.x | |
profile: myaws | |
region: ca-central-1 | |
stackName: fortune-backend | |
package: |
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
export function requestFortune() { | |
fetch('https://a9vymko126.execute-api.ca-central-1.amazonaws.com/test', { method: "GET" }) | |
.then(response => response.json()) | |
.then(data => document.getElementById('fortune-text').innerHTML = data) | |
} |
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
const fortunes = [ | |
"A beautiful, smart, and loving person will be coming into your life.", | |
"A dubious friend may be an enemy in camouflage.", | |
"A faithful friend is a strong defense.", | |
"A feather in the hand is better than a bird in the air.", | |
"A fresh start will put you on your way.", | |
"A friend asks only for your time not your money." | |
]; | |
/** |
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 "./node_modules/rfs/scss.scss"; | |
body { | |
margin: 0; | |
} | |
#content-container { | |
display: flex; | |
height: 100vh; | |
flex-direction: column; |
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
class DPVector(tuple): | |
''' | |
Dot Product (DP) Vector class that overrides the __mul__ | |
implementation to perform dot product operation! | |
''' | |
def __init__(self, tup): | |
self.tup = tup | |
def __mul__(self, other): | |
''' |
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
class Medium(object): | |
def __init__(self, username, age, interests): | |
self.username = username | |
self.age = age | |
self.interal_id=2939 | |
self.interests = interests | |
def __str__(self): | |
''' |
NewerOlder