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 / flash.html
Last active November 1, 2017 11:42
Flash messages in for Flask framework
{% for message in get_flashed_messages() %}
<div class="alert alert-warning">
<button type="button" class="close" data-dismiss="alert">&times;</button>
{{ message }}
</div>
{% endfor %}
<!-- Another template design for using flash messages -->
{% for message in get_flashed_messages() %}
<div class="alert alert-success">
@chidindu-ogbonna
chidindu-ogbonna / manage.py
Created October 27, 2017 13:55
Using Coverage in Flask framework, to be run along with the tests
# Created with a NoneType
cov = None
if os.environ.get('COVERAGE'):
import coverage
# an instance of the coverage.coverage() class is created, using a probable "from_" function of the Coverage class
cov = coverage.coverage(branch=True, include='gasify/*')
cov.start()
app = create_app('default')
@chidindu-ogbonna
chidindu-ogbonna / install_termite.sh
Last active March 18, 2018 01:26
Installation of the termite terminal
#!/usr/bin/env sh
sudo apt-get install -y \
git \
g++ \
libgtk-3-dev \
gtk-doc-tools \
gnutls-bin \
valac \
intltool \
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@chidindu-ogbonna
chidindu-ogbonna / install_vim.txt
Last active March 23, 2018 04:46
Install Vim 8 with Python, Python 3, Ruby and Lua support on Ubuntu 16.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@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
@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

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