Skip to content

Instantly share code, notes, and snippets.

View Robogeek95's full-sized avatar
🌍
Somewhere on earth

Azeez Lukman Robogeek95

🌍
Somewhere on earth
View GitHub Profile
@Robogeek95
Robogeek95 / countUniqueValues.js
Created December 4, 2023 18:43
Multiple Pointers - countUniqueValues
function countUniqueValues(arr) {
if (arr.length === 0) {
return 0;
}
let i = 0; // Slow pointer
for (let j = 1; j < arr.length; j++) {
if (arr[i] !== arr[j]) {
i++;
arr[i] = arr[j];
@Robogeek95
Robogeek95 / validAnagram.js
Created November 21, 2023 09:42
Algorithm to check if two strings are anagrams
function validAnagram(sa, sb) {
if (sa.length !== sb.length) {
return false;
}
const charCount = {};
for (let i = 0; i < sa.length; i++) {
charCount[sa[i]] = (charCount[sa[i]] || 0) + 1;
charCount[sb[i]] = (charCount[sb[i]] || 0) - 1;
@Robogeek95
Robogeek95 / rm_old_artifacts_jfrog.sh
Created December 13, 2022 14:27
clean up old jfrog artifacts
#!/bin/bash
#replace <token> with your artifactory token
#replace <domain> with your artifactory domain name
# pass to the script the $START_TIME for minimum creation time in milliseconds of artifacts (example 1325376000000 for January 1st 2012)
# pass to the script the $END_TIME for maximum creation time in milliseconds of artifacts (example 1388534400000 for January 1st 2014)
# pass to the script the $REPO for the repository where artifacts are located (example: releases)
domain=""
START_TIME="1670626800000"
END_TIME="1670886000000"
@Robogeek95
Robogeek95 / npm-using-https-for-git.sh
Created October 21, 2022 23:05 — forked from taoyuan/npm-using-https-for-git.sh
Force git to use https:// instead of git://
# npm using https for git
git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://
# npm using git for https
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
@Robogeek95
Robogeek95 / fauna-notes.md
Last active June 5, 2021 11:59
FaunaNote: A Serverless note-taking application with Fauna and Next.js
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 1 column 17
---
title: FaunaNote: A Serverless note-taking application with Fauna and Next.js
published: false
description: 
tags: 
cover_image: https://images.unsplash.com/photo-1512314889357-e157c22f938d?ixlib=rb-1.2.1&q=85&fm=jpg&crop=entropy&cs=srgb&w=3600
---

You have probably come across note-taking applications like Notion or Evernote. This article will explore some of the core functionalities of a small note-taking application while introducing you to the Jamstack, Fauna, and the Fauna Query Language (FQL). We’ll discuss leveraging Next.js on the JamStack and the common patterns for reading and writing to the database. Basically, everything you need to get up and running with Fauna.

@Robogeek95
Robogeek95 / scheduling.md
Created December 15, 2020 09:15
Ayomide algorithm

1. FCFS CPU SCHEDULING ALGORITHM

For FCFS scheduling algorithm, read the number of processes/jobs in the system, their CPU burst times. The scheduling is performed on the basis of arrival time of the processes irrespective of their other parameters. Each process will be executed according to its arrival time. Calculate the waiting time and turnaround time of each of the processes accordingly.

Algorithm:

#include<stdio.h>

// #include<conio.h>
@Robogeek95
Robogeek95 / solution.md
Last active December 14, 2020 13:17
Jimmy Algorithm

1. FCFS CPU SCHEDULING ALGORITHM

For FCFS scheduling algorithm, read the number of processes/jobs in the system, their CPU burst times. The scheduling is performed on the basis of arrival time of the processes irrespective of their other parameters. Each process will be executed according to its arrival time. Calculate the waiting time and turnaround time of each of the processes accordingly.

Algorithm:

#include<stdio.h>

// #include<conio.h>
@Robogeek95
Robogeek95 / submission.go
Created November 18, 2020 22:16
matrix-diagonal-sum
func diagonalSum(mat [][]int) int {
result := 0
for i := 0; i < len(mat); i++ {
for j := 0; j < len(mat); j++ {
if i==j || j == len(mat) -i-1 {
result+=mat[i][j]
}
}
}
@Robogeek95
Robogeek95 / valid_parentheses.cpp
Created October 14, 2020 20:49
20. Valid Parentheses
class Solution {
public:
bool isValid(string s) {
stack<char> parentheses;
for (int i = 0; i < s.size(); ++i) {
if (s[i] == '(' || s[i] == '[' || s[i] == '{') parentheses.push(s[i]);
else {
if (parentheses.empty()) return false;
if (s[i] == ')' && parentheses.top() != '(') return false;
if (s[i] == ']' && parentheses.top() != '[') return false;
@Robogeek95
Robogeek95 / gasstation.js
Created September 30, 2020 21:15
gasstation.cpp https://leetcode.com/problems/gas-station/ | my solution in javascript
/**
* @param {number[]} gas
* @param {number[]} cost
* @return {number}
*/
var canCompleteCircuit = function(gas, cost) {
let start=0, gasLeft=0, sum=0; // left-gas left in the tank
for (let i=0; i<gas.length; i++) {
gasLeft+= gas[i] - cost[i];