Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ian Gilkes YenHub

🎯
Focusing
View GitHub Profile
@YenHub
YenHub / debounce.md
Created Mar 31, 2021
Vanilla Javascript Debounce
View debounce.md

Vanilla Javascript Debounce

What is debounce?

This is a vanilla JS version of the infamous Debounce function.

Debounce allows you to delay calls to a function in order to prevent spamming.

A good example of it's application would be an event handler whose event could be fired in multiple time in quick succession.

This function can be used to support JavaScript for the BackOffice non-react pages.

@YenHub
YenHub / ngrok.md
Created Mar 31, 2021
Exposing your local environment for mobile testing | ngrok Setup
View ngrok.md

Exposing your local environment for mobile testing | ngrok Setup

This guide describes the setup process to expose your local (e.g. https://localhost:3000) to the outside web.

This is helpful, for example, when attempting to test and inspect local code changes on a mobile device.

Install

Visit ngrok's website, setup an account & grab the exe

@YenHub
YenHub / vmmem.md
Created Mar 31, 2021
Vmmem Eating All Your Memory??
View vmmem.md

Vmmem Eating All Your Memory??

Simples...

WORKAROUND:

Add the following alias to the tail of ~/.bashrc

# Edit .bashrc (Right click to paste, Ctrl+X to save)
@YenHub
YenHub / twoSum.md
Last active Mar 25, 2021
Leet Code | Two Sum Solution
View twoSum.md

LeetCode | TwoSum

Difficulty:

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

You may assume that each input would have exactly one solution, and you may not use the same element twice.

You can return the answer in any order.

@YenHub
YenHub / merge-sort.js
Created Mar 24, 2021
Javascript Merge Sort
View merge-sort.js
// For each side of a set of arrays
const mergeArrays = (left, right) => {
// Iterate each 0th value moving the vaues into our sorted array
let sortVals = [];
while(left.length && right.length) {
(left[0] < right[0]) ? sortVals.push(left.shift()) : sortVals.push(right.shift());
}
// Return sorted array & anything leftover from either side
@YenHub
YenHub / luhns.c
Created Mar 17, 2021
Luhn's Algorithm in C
View luhns.c
#include <stdio.h>
#include <cs50.h>
string cardType;
// Prompt for a valid card number
long getCardNumber(void)
{
long cardNumber;
cardNumber = get_long("Please enter the card number: ");
@YenHub
YenHub / Fix Local DNS Issues.md
Last active Mar 10, 2021
Temp Fix: DNS Issues, cannot access 'https://some-url.com'
View Fix Local DNS Issues.md

Temporarily Resolve Local DNS Issues

This snippet describes a workaround which can help when you're having issues connecting to a particular resource.

This is of course a temporary work around, however, can certainly get you out of a muddle fast!

For example, if you're unable to get to the nuget host, this guide can help you resolve this (temporarily!)

You can confirm whether you're having DNS issues, if for example, other connectivity otherwise appears fine, and a particular URL or resource will not resolve.

@YenHub
YenHub / websql-example.html
Created Jul 3, 2020 — forked from benpoole/websql-example.html
Javascript & Web SQL example
View websql-example.html
<!DOCTYPE HTML>
<html>
<!--
@author Ben Poole, http://benpoole.com
Example HTML5 code for playing with the local WebKit (Opera too?) SQL database.
@see http://benpoole.com/weblog/201106222227
-->
<head>
<meta charset="UTF-8" />
<title>Winkles Of The World Unite!</title>
@YenHub
YenHub / hyper-v.bat
Last active Feb 12, 2020
Toggle Hyper-V
View hyper-v.bat
@Echo off
setlocal EnableDelayedExpansion
set 1=auto
set 2=off
set 3=exit
Echo/
echo " __ __ __ __ ";
echo " / | / | / | / | ";
echo " $$ | $$ | __ __ ______ ______ ______ $$ | $$ | ";
echo " $$ |__$$ |/ | / | / \ / \ / \ ______ $$ | $$ | ";
@YenHub
YenHub / SDLC.md
Created Sep 27, 2019 — forked from mdang/SDLC.md
Lesson: SDLC
View SDLC.md

The Software Development Life Cycle

Learning Objectives

Conceptual

  • Explain what SDLC is and why we use it
  • Provide a general overview of what "Agile" means and compare it to Waterfall
  • Explain what SCRUM is, and how it relates to agile.
  • Describe the process of requirements gathering.
  • Explain what a user story is, and what specific points it should include.