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 / 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 ~
// 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_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 \
@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 / 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">