Skip to content

Instantly share code, notes, and snippets.

View Cool-sami12's full-sized avatar

Samuel Aniefiok Cool-sami12

View GitHub Profile
@Cool-sami12
Cool-sami12 / index.html
Created September 24, 2021 22:27
NK task
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Menu</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@Cool-sami12
Cool-sami12 / gist:eaa398a4bdb46aca3c6ddd50cf47946f
Created November 21, 2020 00:05
question about static schema in a model
// // find by token
// userSchema.statics.findByToken = function(token,cb){
// var user = this;
// var SECRET= process.env.SECRET;
// jwt.verify(token,SECRET,function(err,decode){
// user.findone({"_id": decode, "token":token},function(err,user){
// if(err) return cb(err);
// cb(null,user);
// })
@Cool-sami12
Cool-sami12 / keybase.md
Created November 15, 2020 06:31
Keybase

Keybase proof

I hereby claim:

  • I am cool-sami12 on github.
  • I am coolsami (https://keybase.io/coolsami) on keybase.
  • I have a public key ASBFgxRH8K2jiJveNyH9vc1Bcec1njJ0kHpwKI9xX46YXwo

To claim this, I am signing this object:

@Cool-sami12
Cool-sami12 / index.html
Last active July 21, 2020 16:59
Header issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JEROME CITY CAKE </title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Karla:wght@400;700&family=Roboto:wght@100;400;700&display=swap"
rel="stylesheet">
const makeValidation = require('@withvoid/make-validation');
const UserModel, { USER_TYPES } = require('../models/user.js');
module.exports = {
onGetAllUsers: async (req, res) => {
try {
const users = await UserModel.getUsers();
return res.status(200).json({ success: true, users });
} catch (error) {
return res.status(500).json({ success: false, error: error })
const makeValidation = require('@withvoid/make-validation');
const UserModel = require('../models/user.js');
const {USER_TYPES} = UserModel;
module.exports = {
onGetAllUsers: async (req, res) => {
try {
const users = await UserModel.getUsers();
return res.status(200).json({ success: true, users });
} catch (error) {
@Cool-sami12
Cool-sami12 / index.js
Created May 17, 2020 17:48 — forked from stephengfriend/index.js
Monk Takes a Walk
// Sample code to perform I/O:
process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";
process.stdin.on("data", function (input) {
stdin_input += input; // Reading input from STDIN
});
process.stdin.resume();
process.stdin.setEncoding("utf-8");
var stdin_input = "";
process.stdin.on("data", function (input) {
stdin_input += input; // Reading input from STDIN
});
process.stdin.on("end", function () {
main(stdin_input); // Execute our entrypoint when we've finished reading the input
@Cool-sami12
Cool-sami12 / gist:cd46c8fd1a6371be80178c4ecf7b301c
Created May 11, 2020 13:09
Random quote generator js functions
const quotes = [
{
quote:"Every person who wins in any undertaking must be willing to cut all sources of retreat. Only by doing so can one be sure of maintaining that state of mind known as a burning desire to win - essential to success.",
source:"Napoleon Hill",
citation: "Brainyquote",
year: 2020
},
{
quote:"Fear is the main source of superstition, and one of the main sources of cruelty. To conquer fear is the beginning of wisdom.",