Skip to content

Instantly share code, notes, and snippets.

View FeezyHendrix's full-sized avatar
💻
Engineering my dreams

Abdulhafeez Abdulraheem FeezyHendrix

💻
Engineering my dreams
View GitHub Profile
@FeezyHendrix
FeezyHendrix / createsuperuser.js
Created December 21, 2021 10:02
Create Super User Node.js MongoDB
const readline = require('readline');
const mongoose = require('mongoose');
const usermodel = require('../models/users.model');
const bcrypt = require('bcrypt');
const database = process.env.MONGODB_URI || "mongodb://localhost:27017/<inputlocaldb>";
mongoose.connect(database, {
useCreateIndex: true,
useNewUrlParser: true,
@FeezyHendrix
FeezyHendrix / main.dart
Created April 10, 2021 21:53
GP Calculator Flutter
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
@FeezyHendrix
FeezyHendrix / ci.yml
Last active September 12, 2020 15:32
Github Actions config for React Native build and send android apk to slack channel
name: Build Android Release Apk
on:
push:
branches:
- release
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
@FeezyHendrix
FeezyHendrix / casting.rs
Created August 26, 2020 20:14
Vectors, HashMaps Casting If-Let, While-Let Result Enum in Rust
fn main() {
// using the as keyword you can cast a type to another
let f = 21.32424242_f32;
let i = f as u8;
let c = i as char;
println!("{} {} {}", f, i , c);
}
@FeezyHendrix
FeezyHendrix / findthepercentage.py
Created August 24, 2020 07:43
Find the Percentage Hackerrank
if __name__ == '__main__':
n = int(input())
student_marks = {}
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks[name] = scores
query_name = input()
percentage = 0
@FeezyHendrix
FeezyHendrix / sieveoferatosthenes.js
Created August 23, 2020 14:39
Sieve of Eratosthenes - Javascript
const sieveofetathothese = (n) => {
// Create a boolean array that holds true for all the range of n
let prime = [];
// initialize the first non-prime number which is 2
let p = 2;
// populate array with the boolean of true
for (let i = 0; i <= n; i++) prime.push(true);
// While the multiples of the current value of p is not more than the number n
while(p * p <= n) {
@FeezyHendrix
FeezyHendrix / secondlowestscore.py
Created August 20, 2020 08:08
Second Lowest Score Python
if __name__ == '__main__':
# create a dictionary
d = {}
for _ in range(int(input())):
name = input()
score = float(input())
# assing name as key and score as value in dictionary
d[name] = score
# assign values to a varible
@FeezyHendrix
FeezyHendrix / secondrunnerup.py
Last active August 19, 2020 13:32
Python Second Runner Up Algorithm
if __name__ == '__main__':
n = int(input())
arr = map(int, input().split())
# Convert the arr variable to a list
a = list(arr)
# a = [2, 4, 5, 2]
# Select the first item in the
@FeezyHendrix
FeezyHendrix / enums.rs
Created August 18, 2020 19:15
Enums and Options in Rust
// Allow for rust to recognized unused code
#[!allow(dead_code)]
// Allow rust to be able to debug enum
#[derive(Debug)]
// Direction enum that each type is type of struct (Point)
enum Direction {
Up(Point),
Down(Point),
Left(Point),
P Q P->Q
T T T
F T T
F T T
F F T