Skip to content

Instantly share code, notes, and snippets.

View IEdiong's full-sized avatar
👨‍🍳
Cooking

Ediongsenyene Joseph IEdiong

👨‍🍳
Cooking
View GitHub Profile
@IEdiong
IEdiong / npx command to run angular cli
Created November 11, 2024 13:05 — forked from ddieppa/npx command to run angular cli
This is the npx command to run angular cli new project without install it globally
npx -p @angular/cli ng new hello-world-project
then locally can run
npx ng g c hello-world-component
@IEdiong
IEdiong / table-of-contents.md
Created September 17, 2024 05:20 — forked from isaacplmann/table-of-contents.md
Advanced Angular Patterns
@IEdiong
IEdiong / nodejs.errno.h
Created March 17, 2023 10:51 — forked from pbojinov/nodejs.errno.h
node.js errno descriptions. Useful for debugging.
/* Pulled from https://github.com/joyent/node/blob/master/deps/uv/include/uv.h */
/* Expand this list if necessary. */
#define UV_ERRNO_MAP(XX) \
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
XX(EADDRNOTAVAIL, "address not available") \
XX(EAFNOSUPPORT, "address family not supported") \
XX(EAGAIN, "resource temporarily unavailable") \
XX(EAI_ADDRFAMILY, "address family not supported") \
@IEdiong
IEdiong / revert-a-commit.md
Created August 26, 2022 06:13 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@IEdiong
IEdiong / sort_diagonal.py
Last active April 20, 2022 15:39
Sort the diagonals in ascending order from bottom left to top right of a given a squared matrix of positive integers implemented in python
def solution(matrix):
M, N, diagonals = len(matrix), len(matrix[0]), []
# 1. Get all the diagonals
for row in range(0, M):
col, temp, i = 0, [], row
j = col
while i >= 0 and j < N:
temp.append(matrix[i][j])
@IEdiong
IEdiong / matrixElementsSum.js
Created April 18, 2022 20:50
Code Signal matrixElementsSum Solution in JS
function solution(matrix) {
const hauntedRoom = {};
const numberOfFloors = matrix.length;
const numberOfRooms = matrix[0].length;
let total = 0;
// 1. Loop through each row
for (let floor = 0; floor < numberOfFloors; floor++) {
// 2. For each element in the row
for (let room = 0; room < numberOfRooms; room++) {
@IEdiong
IEdiong / removeKFromList.js
Last active April 17, 2022 15:18
Code Signal: removeKFromList solution -- Interview Practice__Linked List - 01 (Easy)
// Singly-linked lists are already defined with this interface:
// function ListNode(x) {
// this.value = x;
// this.next = null;
// }
//
function solution(l, k) {
if (l === null) return l; // return if the linked list is empty
let dummyNode = new ListNode(); // create a dummy node whose next points to the head of the given Linked List
@IEdiong
IEdiong / containsDuplicate.js
Created December 19, 2021 00:49
LeetCode Data Structure I: Day 1 - 001
// 217. Contains Duplicate
// Easy
// Given an integer array nums, return true if any value appears at least twice in the array, and return false if every element is distinct.
const containsDuplicate = (nums) => {
// create an empty dictionary
// iterate through the array
// for each integer in the array check if the integer position exists in the dictionary
// if 'yes' return 'true'