Skip to content

Instantly share code, notes, and snippets.

View elchroy's full-sized avatar

Elisha-Wigwe Chijioke O. elchroy

  • Lagos, Nigeria
View GitHub Profile
@elchroy
elchroy / README.md
Created October 24, 2022 20:18 — forked from paolocarrasco/README.md
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to commit and suddenly you see this error message after it:

error: gpg failed to sign the data
fatal: failed to write commit object

Debug

@elchroy
elchroy / System Design.md
Created June 13, 2022 11:47 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@elchroy
elchroy / vs_code_extensions.md
Created April 28, 2022 09:23 — forked from robgeorgeuk/vs_code_extensions.md
My VSCode Extensions for Laravel Develoment
@elchroy
elchroy / generate_blocks.sh
Created April 2, 2022 09:28 — forked from System-Glitch/generate_blocks.sh
Tutorial for bitcoin regtest
# Script to generate a new block every minute
# Put this script at the root of your unpacked folder
#!/bin/bash
echo "Generating a block every minute. Press [CTRL+C] to stop.."
address=`./bin/bitcoin-cli getnewaddress`
while :
do
@elchroy
elchroy / scss-color-names.scss
Created June 9, 2020 16:46
CSS color names as SCSS variables
$aliceblue: #f0f8ff;
$antiquewhite: #faebd7;
$aqua: #00ffff;
$aquamarine: #7fffd4;
$azure: #f0ffff;
$beige: #f5f5dc;
$bisque: #ffe4c4;
$black: #000000;
$blanchedalmond: #ffebcd;
$blue: #0000ff;
@elchroy
elchroy / cs-bin-gists.js
Created August 14, 2019 18:53
Will Sentance FEMasters CS Bin Promises - http://csbin.io/promises
// Challenge 1
function sayHello() {
setTimeout(() => console.log('Hello'), 1000);
}
// Uncomment the line below when ready
sayHello(); // should log "Hello" after 1000ms
<?php
$arr = [1, 2, 3, 4, 5];
function rotLeft($a, $d) {
$res = [];
$count = count($a);
array_walk($a, function ($e, $i) use (&$a, $d, $count, &$res) {
$res[$i] = $a[($i+$d)%$count];
<?php
function reverseArray($a) {
$len = count($a);
$i = 0;
$res = [];
while ($i < $len) {
$j = abs($i - $len) - 1;
$res[] = $a[$j];
$i++;
@elchroy
elchroy / make_change.js
Created July 3, 2019 12:32
Different implementations of `makeChange` problem.
// Write a function, makeChange, that returns an integer
// that represents the least number of coins that add up
// to an amount where the amount is always divisible by 5
const availableCoins = {
5: 0,
10: 0,
25: 0
}
@elchroy
elchroy / some_algos.js
Created July 3, 2019 12:24
Factorial, Fibonacci, Search Algorithms, etc. See sorting.js for sorting algorithms
module.exports = {
isUnique (arr) {
let result = true;
let count = 0;
for (let i = 0; i < arr.length; i++) {
console.log(`OUTER LOOP ~~~~ i === ${i}`);
for (let j = 0; j < arr.length; j++) {
console.log(`INNER LOOP ~~~~ j ==== ${j}, and ${++count}`);
// apart from the current index where i and j are equal