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 express, { Request, Response } from 'express'; | |
import { Ticket } from '../models/tickets'; | |
import { body } from 'express-validator'; | |
import { requireAuth, validateRequest } from '@byte_b/common'; | |
const router = express.Router(); | |
router.post( | |
'/api/tickets', | |
requireAuth, | |
[ |
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 request from 'supertest'; | |
import app from '../../app'; | |
import { Ticket } from '../../models/tickets'; | |
it('has a route handles listening to /api/tickets for post requests', async () => { | |
const response = await request(app).post('/api/tickets').send({}); | |
expect(response.status).not.toEqual(404); | |
}); | |
it('Only a signed in user can access, should get a 401 response', async () => { |
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
#include <bits/stdc++.h> | |
using namespace std; | |
struct Node | |
{ | |
int data; | |
struct Node *next; | |
struct Node *prev; | |
}; //*head = NULL; | |
struct Node *head = NULL; |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: factorio | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: factorio | |
template: |
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, { useEffect, useState } from 'react'; | |
import Axios from 'axios'; | |
import moment from 'moment'; | |
import { Link } from 'react-router-dom'; | |
import styles from './Heading.module.css'; | |
import './BookBus.css'; | |
import Header from './Header'; | |
function BookBus({ user, match, history, selectedBus }) { | |
//Setting state for bus with temporary values |
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::io; | |
fn main() { | |
let N: usize; | |
loop { | |
println!("How many elements would you like to enter : "); | |
let mut n = String::new(); | |
io::stdin().read_line(&mut n).expect("Input needed"); | |
match n.trim().parse::<usize>() { | |
Ok(val) => { | |
println!("N : {}", val); |