Skip to content

Instantly share code, notes, and snippets.

View rotimi-best's full-sized avatar
👨‍💻
Inventing the future

Rotimi Best rotimi-best

👨‍💻
Inventing the future
View GitHub Profile
@rotimi-best
rotimi-best / Additional common aliases.csv
Created November 17, 2018 19:20 — forked from iaincollins/Additional common aliases.csv
🌍 ⁉️ WHAT EVEN ARE COUNTRIES
iso2 alias
BM Islands of Bermuda
BM The Islands of Bermuda
BM Bermudas
BM The Bermudas
BM Somers Isles
BM The Somers Isles
BS Bahama
BS Bahamas
BS The Bahamas
@rotimi-best
rotimi-best / epubtopdf.md
Last active January 1, 2019 21:46
A todo for creating a file converting telegram bot.

Todos - Conversion bot - Epub to pdf

  • Get the document

Check if file is epub else reject file

Document {

  _fileId: 'BQADBAADigMAAlO0OFN7fDAlnFZSHQI',
@rotimi-best
rotimi-best / countries.js
Last active February 14, 2019 06:54
Nodejs Array of Countries
const countries = ["Afghanistan", "Aland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Barbuda", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Trty.", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Caicos Islands", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faro
@rotimi-best
rotimi-best / ICO.html
Last active February 20, 2022 20:02
ICO Landing Page
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flexboxgrid/6.3.1/flexboxgrid.min.css">
<!-- HEADER WITH NAVIGATION BAR -->
<header id="main-header">
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-4 col-md-4 col-lg-4">
<h1><a href="#">LeviClan</a></h1>
@rotimi-best
rotimi-best / python-es6-comparison.md
Created April 18, 2019 17:24 — forked from revolunet/python-es6-comparison.md
# Python VS ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@rotimi-best
rotimi-best / merge.md
Last active June 4, 2024 08:10
How to merge one folder within two branches in git

git - How to merge one folder within two branches

In my project folder I have 2 folders client and server, I only want get the changes in my server folder from master to prod branch

  1. git checkout prod - Go to the branch with the oldest changes
  2. git merge --no-commit --no-ff master - Merge with the branch with the latest changes. Read More
  3. git reset -- client* - Unstage any changes from client folder, I only want to server folder. Read More
  4. git checkout -- client* - Remove any changes from client folder, I only want to server folder.
  5. git clean -n - View all unstaged files. Read More
  6. git clean -fd - Remove all unstaged folder, if you dont want to remove all then you should add those with git add and then run this command. Read More
@rotimi-best
rotimi-best / Include-in-Sequelize.md
Created June 19, 2019 10:51 — forked from zcaceres/Include-in-Sequelize.md
using Include in sequelize

'Include' in Sequelize: The One Confusing Query That You Should Memorize

When querying your database in Sequelize, you'll often want data associated with a particular model which isn't in the model's table directly. This data is usually typically associated through join tables (e.g. a 'hasMany' or 'belongsToMany' association), or a foreign key (e.g. a 'hasOne' or 'belongsTo' association).

When you query, you'll receive just the rows you've looked for. With eager loading, you'll also get any associated data. For some reason, I can never remember the proper way to do eager loading when writing my Sequelize queries. I've seen others struggle with the same thing.

Eager loading is confusing because the 'include' that is uses has unfamiliar fields is set in an array rather than just an object.

So let's go through the one query that's worth memorizing to handle your eager loading.

The Basic Query

@rotimi-best
rotimi-best / awss3-upload-delete-image-nodejs.js
Last active August 11, 2019 15:44
How to upload and delete images from your AWS S3 bucket with NodeJS
// npm i aws-sdk
const AWS = require('aws-sdk')
// npm i uuid
const uuidv4 = require('uuid/v4');
let s3 = null;
if (!s3) {
// Get these credential from the file you downloaded in your console
// https://help.bittitan.com/hc/en-us/articles/115008255268-How-do-I-find-my-AWS-Access-Key-and-Secret-Access-Key
@rotimi-best
rotimi-best / sheet-to-json.js
Last active August 19, 2019 10:07
Convert your google spreadsheet data to json
// 1. Open your google spreadsheet
// 2. Tools > Script editor
// 3. Copy the code and paste in the editor.
// 4. Save the file and run it (you may need to give permissions)
function exportSheetAsJSON() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
var numCols = rows.getNumColumns();