Skip to content

Instantly share code, notes, and snippets.

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

AbdulSamii Ajala jalasem

🏠
Working from home
View GitHub Profile
public static long carParkingRoof(List<Long> cars, int k) {
// Write your code here
if (cars.size() == 0 || k < 0) {
return 0;
}
Collections.sort(cars);
long minDist = Long.MAX_VALUE;
for (int i = 0; i <= cars.size() - k; i++) {
[
{
"name": "Badamus",
"profession": "Programmer",
"age": 27,
"skills": ["HTML/CSS", "JS", "React"]
},
{
"name": "Adelaja",
"profession": "Project Manager",

Simple NodeJS Application


const requestHandler = (req, res) => {
  res.end("<h1>Hello Villagers</h1>");
};

const server = http.createServer(requestHandler);

server.listen(9010, () =&gt; {
@jalasem
jalasem / index.html
Last active November 21, 2020 23:02
Deendemy
<div class="p-4 bg-deenGreen">
<nav class="h-20 bg-white rounded flex items-center justify-between mt-2">
<div class="text-xl pl-4 text-gray-500 flex items-center">
<span class="h-8 w-8 mr-2 bg-deenGreen rounded"></span>
<span>Deendemy</span>
</div>
<div class="flex items-center text-sm font-medium">
<span class="py-1 px-4">Explore</span>
<span class="py-1 px-4">Categories</span>
<span class="py-1 px-4">Teach on Deendemy</span>
@jalasem
jalasem / villagers.json
Created September 10, 2020 10:45
Sample JSON object
{
"bdmus772": {
"name": "Badmus Adimula",
"spouse": "Salamat Ajirebi",
"car": "Maerati",
"address": "Pawpaw Island, Kwara State",
"age": 38,
"accountBal": "$1,000,000,000,922.78",
"spending": true,
"pastJob": [
{
"quotes": [
{
"quote":"Life isn’t about getting and having, it’s about giving and being.","author":"Kevin Kruse"},
{
"quote":"Whatever the mind of man can conceive and believe, it can achieve.","author":"Napoleon Hill"},
{
"quote":"Strive not to be a success, but rather to be of value.","author":"Albert Einstein"},
{
@jalasem
jalasem / .oh-my-zsh_zshrc-configs
Created January 30, 2020 16:54
zsh config script
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/jalasem/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@jalasem
jalasem / Hacking Winterfell.js
Created October 7, 2019 00:49
Hacking Winterfell Problem
/**
* Requirement
Having had a restless nights sleep, you’ ve woken up in a daze and have found yourself in Westeros.Confused, the sun is just beginning to rise and yet in the distance, you can hear crowds jeering, roaring battle cries and a stampede of horses charging into what seems like a long - awaited battle.
Suddenly, you realise what’ s happening.The time has
finally come.The Seven Kingdoms are at war and with one common goal;
to defeat the White Walkers and the dreaded Night King who leads them.
@jalasem
jalasem / class express
Created July 22, 2019 10:07
class based express server
const express = require('express')
const path = require('path')
const open = require('open')
class Server {
constructor(port, app) {
this.port = port
this.app = app
}
core() {
const cluster = require('cluster')
const express = require('express')
const fs = require('fs')
const CPUs = require('os')
.cpus()
.length
if (cluster.isMaster) {
console.log(`Master cluster setting up ${CPUs} workers...`)