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 / biblebooks.js
Created October 14, 2020 23:02 — forked from mastastealth/biblebooks.js
Simple JS array of the books of the Bible
var books = [
'Genesis',
'Exodus',
'Leviticus',
'Numbers',
'Deuteronomy',
'Joshua',
'Judges',
'Ruth',
'1 Samuel',
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@rotimi-best
rotimi-best / mysql_backup.sh
Created February 15, 2020 14:54 — forked from tleish/mysql_backup.sh
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@rotimi-best
rotimi-best / CalendlyEmbedReact.js
Created February 11, 2020 19:07 — forked from oak-wildwood/CalendlyEmbedReact.js
Calendly Embed React component
import React from 'react';
class CalendlyEmbed extends React.Component {
calendlyScriptSrc = 'https://assets.calendly.com/assets/external/widget.js'
buildCalendlyUrl = (account, eventName) =>
`https://calendly.com/${account}/${eventName}`
componentDidMount() {
const head = document.querySelector('head')
const script = document.createElement('script')
@rotimi-best
rotimi-best / magic-globals.js
Created October 22, 2019 07:12 — forked from gavinengel/magic-globals.js
"Magic Globals" for node.js
// sets globals:
// __stack,
// __line,
// __file,
// __function,
// __ext,
// __base
// we already have these:
// __filename which gives as an example: /Users/mjr/example.js
@rotimi-best
rotimi-best / test.js
Created August 28, 2019 16:39 — forked from danmakenoise/test.js
Unit Testing Children of React Context API Consumers with Enzyme
// Component.js
const Component = props => (
<MyContext.Consumer>
{(context) => (
<Foo
bar={props.bar}
baz={context.baz}
/>
)}
</MyContext.Consumer>
@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 / 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 / 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