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 JwtStrategy = require('passport-jwt').Strategy; | |
const ExtractJwt = require('passport-jwt').ExtractJwt; | |
const mongoose = require('mongoose'); | |
import User from '../models/users'; | |
const opts = {}; | |
opts.jwtFromRequest = ExtractJwt.fromAuthHeaderAsBearerToken(); | |
opts.secretOrKey = process.env.JWT_SECRET; | |
module.exports = passport => { |
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
var express = require('express'); | |
var router = express.Router(); | |
// Used to perfrom signature authentication | |
var ethUtil = require('ethereumjs-util'); | |
// JWT generation and verification | |
const jwt = require('jsonwebtoken'); | |
import passport from 'passport' |
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
<script> | |
import Web3 from 'web3' | |
export default ({ | |
data() { | |
return { | |
buttonDisabled: false, | |
buttonInstallText: "Click here to install Metamask", | |
} | |
}, |
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
# Login to Azure using Service Principal credentials from Github Secrets | |
Write-Output "Logging in to Azure with a service principal..." | |
az login ` | |
--service-principal ` | |
--username $Env:SP_CLIENT_ID ` | |
--password $Env:SP_CLIENT_SECRET ` | |
--tenant $Env:SP_TENANT_ID | |
Write-Output "Done" | |
# Select Azure subscription |
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
on: [workflow_dispatch] | |
name: DeployAzureVM | |
jobs: | |
CreateAzureVM: | |
runs-on: windows-latest | |
steps: |
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
# # C1: Each room can only hold 1 class at a time | |
def check_C1(self, A, a, B, b): | |
if a[0] == b[0] and a[1] == b[1] and a[2] == b[2]: | |
return False | |
return True | |
# # C2: Each student (class) can only attend a class at a time | |
def check_C2(self, A, a, B, b): | |
for key in dict1: |
NewerOlder