Skip to content

Instantly share code, notes, and snippets.

View chidindu-ogbonna's full-sized avatar
👽

Promise Ogbonna chidindu-ogbonna

👽
View GitHub Profile
@chidindu-ogbonna
chidindu-ogbonna / service-worker.js
Created April 30, 2019 11:22
Including workbox in service workers
self.__precacheManifest = [].concat(self.__precacheManifest || []);
workbox.setConfig({ debug: true }); // show debugging even during development
workbox.precaching.suppressWarnings();
workbox.precaching.precacheAndRoute(self.__precacheManifest, {});
console.log("%c Workbox is activated", "font-size: 30px; color: blue");
// Enable offline analytics
workbox.googleAnalytics.initialize();
@chidindu-ogbonna
chidindu-ogbonna / vuefire.md
Last active April 30, 2019 11:25
Solution to binding vuefire to components
@chidindu-ogbonna
chidindu-ogbonna / cymath.py
Created December 14, 2018 09:22
Basic API example for https://cymath.com
"""
DISCLAIMER
I am not responsible for any actions or usage of this API, the api clearly states
"Restricted Access. We may pursue legal actions over unauthorized uses of this API."
This script is for educational purposes ONLY
"""
@chidindu-ogbonna
chidindu-ogbonna / list_comprehensions.py
Created April 29, 2018 05:23
TIL - Saw something new in list comprehensions
# Today I Learned using if/else in list comprehension is not as straight forward
# Correct
list_of_values = [a if a else 2 for a in [0, 1, 0, 3]]
# Correct
list_of_values = [a for a in [0, 1, 0, 3] if a]
# Wrong : Raises Syntax Error
list_of_values = [a if a for a in [0, 1, 0, 3]]
@chidindu-ogbonna
chidindu-ogbonna / Writing_a_request_response_to_file.py
Last active June 27, 2018 21:31
Downloading a file with the requests module
import requests
import shutil
import json
# Writing a json response from an API to file
r = requests.get('http://api.domain.com')
with open('file.json', 'w') as f:
json.dump(r.json(), f, indent=2)
@chidindu-ogbonna
chidindu-ogbonna / custom-ubuntu1604.sh
Created March 25, 2018 09:40 — forked from evertontrindade/custom-ubuntu1604.sh
Things to do after install ubuntu 16.04
# First you update your system
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y
# Cleanup system
sudo apt-get purge account-plugin-facebook
sudo apt-get purge account-plugin-flickr
sudo apt-get purge account-plugin-google
sudo apt-get purge aisleriot
sudo apt-get purge fonts-opensymbol libreoffice libreoffice-\* openoffice.org-dtd-officedocument1.0 python\*-uno uno-libs3-\* ure ure-dbg
sudo apt-get purge gnome-terminal

Here is a non-exhaustive list of books that have influenced how I think about software.

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a
@chidindu-ogbonna
chidindu-ogbonna / README-Template.md
Created March 25, 2018 09:32 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@chidindu-ogbonna
chidindu-ogbonna / regex.md
Created March 24, 2018 04:08 — forked from vitorbritto/regex.md
Regex Cheat Sheet

Regular Expressions

Basic Syntax

  • /.../: Start and end regex delimiters
  • |: Alternation
  • (): Grouping