Skip to content

Instantly share code, notes, and snippets.

View oo1john's full-sized avatar
🚀
Lost in Design

John oo1john

🚀
Lost in Design
View GitHub Profile
# https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03
brew cask install android-sdk
brew cask install android-ndk
@oo1john
oo1john / README.md
Created October 30, 2017 13:07 — forked from twolfson/README.md
Python unittest `setUp` inheritance

In some cases for Python unit tests, we want to automatically perform setUp methods in as declared in a base class. However, we still want setUp to work as per normal in the subclass. The following code will proxy the new setUp function to run it's base class' and the new one.

# Define a common test base for starting servers
class MyBaseTestCase(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        """On inherited classes, run our `setUp` method"""
        # Inspired via http://stackoverflow.com/questions/1323455/python-unit-test-with-base-and-sub-class/17696807#17696807
        if cls is not MyBaseTestCase and cls.setUp is not MyBaseTestCase.setUp:
events {
worker_connections 1024;
}
http {
default_type text/html;
access_log /dev/stdout;
sendfile on;
keepalive_timeout 65;
brew tap caskroom/cask
brew cask install vagrant
brew cask install virtualbox
@oo1john
oo1john / timestamp.py
Created March 23, 2017 11:56 — forked from ju-popov/timestamp.py
Python DateTime / Timestamp Convertion
######################################################################
# CURRENT AWARE LOCAL DATETIME
######################################################################
from datetime import datetime
from tzlocal import get_localzone
local_tz = get_localzone()
local_dt = datetime.now(local_tz)
# mysql installed on brew
cd /usr/local/Cellar/mysql/5.7.16/bin/
sudo mysql_upgrade
# http://stackoverflow.com/questions/8484722/access-denied-for-user-rootlocalhost-while-attempting-to-grant-privileges
mysql -u root -p -hlocalhost
FLUSH PRIVILEGES;
SELECT user();
SELECT current_user();
# install docker for mac
https://docs.docker.com/engine/installation/mac/
# install docker compose
curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# build and run container
docker build -t info-php .
docker run -p 80:80 -v /Users/john/Dev/learn/docker/app1_container/src:/var/www/html/ info-php
# https://www.virtualbox.org
# https://www.vagrantup.com
# https://box.scotch.io
# https://scotch.io/bar-talk/announcing-scotch-box-2-0-our-dead-simple-vagrant-lamp-stack-improved
# vagrant box add scotch/box
# vagrant init
# vagrant up
# vagrant ssh
# https://www.virtualbox.org
# https://www.vagrantup.com
# https://box.scotch.io
# https://scotch.io/bar-talk/announcing-scotch-box-2-0-our-dead-simple-vagrant-lamp-stack-improved
# vagrant box add scotch/box
# vagrant init
# vagrant up
# vagrant ssh
@oo1john
oo1john / Vagrant
Last active December 2, 2016 21:50
# https://www.virtualbox.org
# https://www.vagrantup.com
# https://box.scotch.io
# https://scotch.io/bar-talk/announcing-scotch-box-2-0-our-dead-simple-vagrant-lamp-stack-improved
# vagrant box add scotch/box
# vagrant init
# vagrant up
# vagrant ssh