Skip to content

Instantly share code, notes, and snippets.

View tksilicon's full-sized avatar
🏠
Working from home

ThankGod Ukachukwu tksilicon

🏠
Working from home
View GitHub Profile
@tksilicon
tksilicon / deps.ts
Last active December 11, 2020 08:34
export {
deferred,
Deferred,
delay,
} from "https://deno.land/std@0.51.0/async/mod.ts";
export { decode, encode } from "https://deno.land/std@0.51.0/encoding/utf8.ts";
export {
assertEquals,
assertThrowsAsync,
} from "https://deno.land/std@0.51.0/testing/asserts.ts";
export {
getStr,
setStr,
setArr,
} from "https://deno.land/x/sqlite/src/wasm.ts";
export { Status, Values } from "https://deno.land/x/sqlite/src/constants.ts";
export {
Rows,
import {
getStr,
setStr,
setArr,
Status,
Values,
Rows,
Empty,
log,
} from "./sqlite_deps.ts";
export {
Pool,
PostgresError
} from "https://deno.land/x/postgres/mod.ts";
export {
Connection
} from "https://deno.land/x/postgres/connection.ts";
export {
import {
Connection, ConnectionOptions, createParams,
QueryPostgres, QueryConfig, QueryResult, PostgresError, log
} from "./postgres_deps.ts";
/** Transaction processor */
export interface TransactionProcessor<T> {
(connection: Connection): Promise<T>;
}
let graphAdj;
let visited;
let stack;
const initGraph = (maxVertice) => {
visited = new Array(maxVertice);
stack = []
@tksilicon
tksilicon / bfs.js
Last active August 22, 2023 00:26
// Online Javascript Editor for free
// Write, Edit and Run your Javascript code using JS Online Compiler
let graphAdj;
var visited;
let queue;
const initGraph = (maxVertice) => {
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let player = 'X';
let ticktacktoe = [
router.post(
'/customers',
check('email').isEmail(),
CustomerController.create
);
router.post(
'/customers/login',
passport.authenticate('login'),
static async create(req, res, next) {
try {
const errors = validationResult(req); // Finds the validation errors in this request and wraps them in an object with handy functions
if (!errors.isEmpty()) {
return res.status(422).json({
error: {
code: `USR_03`,
message: `The email is invalid.`, // eslint-disable-line
field: `email`,