Skip to content

Instantly share code, notes, and snippets.

View KingAbesh's full-sized avatar
🍐
Preaching Javascript

Abasifreke Ekwere KingAbesh

🍐
Preaching Javascript
View GitHub Profile
@donejeh
donejeh / bankcode.txt
Last active April 7, 2024 21:38
Nigeria Banks Code List
'120001' '9mobile 9Payment Service Bank'
'801' 'Abbey Mortgage Bank'
'51204' 'Above Only MFB'
'51312' 'Abulesoro MFB'
'044' 'Access Bank'
'063' 'Access Bank (Diamond)'
'120004' 'Airtel Smartcash PSB'
'035A' 'ALAT by WEMA'
'50926' 'Amju Unique MFB'
'50083' 'Aramoko MFB'
@dhh
dhh / Gemfile
Created June 24, 2020 22:23
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@aesrael
aesrael / Trie.js
Last active July 26, 2020 11:57
Tries and shortest unique prefixes using Tries
class TrieNode {
constructor(value){
this.value = value
this.isLastNode = false
this.parent = null
this.children = {}
this.frequency = 0
}
tranverse() {
@bradtraversy
bradtraversy / node_nginx_ssl.md
Last active May 29, 2024 20:54
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@anthonydmays
anthonydmays / sortable_indices.js
Last active September 3, 2020 05:50
Given an array of integers, write a method to find indices m and n such that if you sorted elements m through n, the entire array would be sorted. Minimize n - m (that is, find the smallest such sequence). Watch interview coach and Google engineer Anthony D. Mays solve this problem in real time on YouTube: https://youtu.be/Q8HlPVWdssk.
/**
* Given an array of integers, write a method to find indices m and n such that
* if you sorted elements m through n, the entire array would be sorted.
* Minimize n - m (that is, find the smallest such sequence).
*/
function findSortableIndices(arr) {
let i = 1;
let max = arr[0];
let minUnsorted = Number.MAX_VALUE;

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@astoilkov
astoilkov / readme.md
Last active March 13, 2024 10:19
Async Operations with useReducer Hook

Async Operations with useReducer Hook

9 March, 2019

We were discussing with @erusev what we can do with async operation when using useReducer() in our application. Our app is simple and we don't want to use a state management library. All our requirements are satisfied with using one root useReducer(). The problem we are facing and don't know how to solve is async operations.

In a discussion with Dan Abramov he recommends Solution 3 but points out that things are fresh with hooks and there could be better ways of handling the problem.

Problem

@bradtraversy
bradtraversy / docker-help.md
Last active May 26, 2024 10:33
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@umutakturk
umutakturk / jsonp_decode.php
Created September 29, 2012 19:10
JSONP Decode
<?php
$jsonp_string = preg_replace("/[^(]*\((.*)\)/", "$1", file_get_contents("http://api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=http://9gag.com/"));
$json = json_decode($jsonp_string, true);
echo $json['count'];
?>