Skip to content

Instantly share code, notes, and snippets.

View chidimo's full-sized avatar
💭
Building awesome apps, one line at a time

Orji Chidi Matthew chidimo

💭
Building awesome apps, one line at a time
View GitHub Profile
// Learning styles
const learningStyles = [
{
social: [
'Learn by being told—through lessons, lectures, presentations.',
'Learn by asking someone what you want to know.',
'Learn by working cooperatively with others as a team.',
'Learn by teaching someone else.',
'Learn by working or studying with a mentor.',
@chidimo
chidimo / author-amend.sh
Created August 29, 2019 23:50 — forked from TheCodedSelf/author-amend.sh
Change all commits with author email "bruce.wayne@wayneenterprises.com" to "batman@justiceleague.com"
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="bruce.wayne@wayneenterprises.com"
CORRECT_NAME="The Dark Knight"
CORRECT_EMAIL="batman@justiceleague.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@chidimo
chidimo / comparison-of-hof-python-javascript.md
Last active May 15, 2019 15:32
Comparison of Higher Order Functions (HOF) in Python and JavaScript

JavaScript Code

let salute = (age) => {
    let showAge = (name) => {
        console.log(`Welcome ${name}`)
        console.log(`Your age is ${age}`)
    }
    return showAge
}
@chidimo
chidimo / custom_ipython_kernel.md
Last active September 24, 2019 10:33
How to create a custom ipython, aka jupyter notebook kernel with a python virtual environment

Creating a custom ipython or jupyte notebook kernel

  1. Create a python virtual environment using either pipenv or virtualenv

  2. Open up cmd.exe, activate the virtual environment and issue the following to commands

    pipenv install jupyter

    pipenv install ipykernel

  3. To create the custom ipython kernel, issue the following commands

@chidimo
chidimo / country_tuples.md
Last active March 19, 2024 10:40
A list of countries of the world and their abbreviations as python tuples

Countries as tuples

Code

from pywebber import Ripper
def get_countries_as_tuples():
    """Get list of countries and their abbreviations as a tuple of tuples"""
    p = Ripper('http://abbreviations.yourdictionary.com/articles/country-abbreviations.html')
    c = p.soup.find('div', id='article_main_content')
@chidimo
chidimo / virtualenv.md
Created March 26, 2018 14:42
Creating and working with python virtual environments in windows

Creating and working with python virtual environments in windows

Assumption

I assume here that you have python installed in your system. Or perhaps you have a package manager such as Anaconda or Canopy and that you have your path variables setup correctly. If you don't then head over to any of these pages and download a python installation to start with. I recommend Anaconda personnally. But use any one of your choice

Warning these files are usually large, so you may want to use a non-metered connection.

Setting up your system path

@chidimo
chidimo / django_environment.md
Last active February 5, 2018 11:11
Managing environment variables in Django projects

Technology

Django==2.0, virtualenv==15.1.0, virtualenvwrapper-win==1.2.4

Assumptions

  1. You're using a separatevirtual environment to run each django project.
  2. You're on windows. I'm on windows 10 specifically.

Problem statement 1

How do you handle your django settings.py file properly so that development and production settings are kept clean, apart, and well-organized?

@chidimo
chidimo / webIndexer.py
Last active February 4, 2018 07:14
Functions to index the web. To use, just modify seedPage and n. The seed page and the depth of index you want. You have to see the output in a text file. Its a python dictionary dumped as json
from collections import OrderedDict
from operator import itemgetter
import pprint
import requests
import bs4
import json
import time
import re
# returns a BS object of a webpage