Skip to content

Instantly share code, notes, and snippets.

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

Waheed Afolabi wptechprodigy

🏠
Working from home
View GitHub Profile
@wptechprodigy
wptechprodigy / master-javascript-interview.md
Created March 28, 2019 08:23 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@wptechprodigy
wptechprodigy / revert-a-commit.md
Created April 3, 2019 11:55 — 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:

@wptechprodigy
wptechprodigy / codility_solutions.txt
Created November 27, 2019 14:54 — forked from lalkmim/codility_solutions.txt
Codility Solutions in JavaScript
Lesson 1 - Iterations
- BinaryGap - https://codility.com/demo/results/trainingU2FQPQ-7Y4/
Lesson 2 - Arrays
- OddOccurrencesInArray - https://codility.com/demo/results/trainingFN5RVT-XQ4/
- CyclicRotation - https://codility.com/demo/results/trainingSH2W5R-RP5/
Lesson 3 - Time Complexity
- FrogJmp - https://codility.com/demo/results/training6KKWUD-BXJ/
- PermMissingElem - https://codility.com/demo/results/training58W4YJ-VHA/
@wptechprodigy
wptechprodigy / README-Template.md
Created December 22, 2019 11:30 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@wptechprodigy
wptechprodigy / helloGithubGist.js
Last active January 24, 2020 18:45
My first Github Gist
const name = 'Github Gist';
console.log(`Hello ${name}`);
@wptechprodigy
wptechprodigy / composing-software.md
Created January 30, 2020 06:36 — forked from rosario/composing-software.md
Eric Elliott's Composing Software Series
@wptechprodigy
wptechprodigy / warnTheDeveloper.js
Last active April 29, 2020 15:57
Health Status Test Solution
/**
* Gets the seat number of the develper to get the last sweet
* of some sweets distributed as a treat to developers. The last sweet
* happens to taste AWFUL.
*
* @param n Number of developers
* @param m Number of sweets
* @param s Chair number to begin passing out sweets
*
* @returns Seat number of the developer to be warned
@wptechprodigy
wptechprodigy / sampleNaming.swift
Last active August 4, 2021 14:42
DayOne - Variables and Types in Swift
import Foundation
// MARK: - VARIABLES
/*
Variables are data stored that can have their value change whenever we want it and
constant are value that can not be changed.
The advantage of using var in declaring a variable and let in declaring a constant is that
it help xcode to remind us of the constant we have set and whenever we try to change it,
@wptechprodigy
wptechprodigy / UnitTestingSceneDelegateGist.md
Created October 26, 2021 07:08 — forked from HiddenJester/UnitTestingSceneDelegateGist.md
Mocking SceneDelegate for Unit Tests on iOS 13

Replacing the SceneDelegate When Running Unit Tests

Overview

I've been working through the exercises in the excellent iOS Unit Testing by Example book by Jon Reid, which I highly recommend. However, the book is in beta at the moment and there are some curveballs thrown by iOS 13 that aren't handled in the text yet. Specifically, when I hit the section about using a testing AppDelegate class I thought "This is very good. But what about the SceneDelegate?"

In Chapter 4 the recommendation is to remove the @UIApplicationMain decoration and make a manual top-level call to UIApplicationMain. To wit:

import UIKit
enum HTTPMethod: String {
case delete = "DELETE"
case get = "GET"
case patch = "PATCH"
case post = "POST"
case put = "PUT"
}
enum HTTPScheme: String {
case http