Skip to content

Instantly share code, notes, and snippets.

View Nditah's full-sized avatar
🏠
Working from home

Ndi-tah Samweld Nditah

🏠
Working from home
View GitHub Profile
@Nditah
Nditah / contactList.py
Last active March 30, 2018 11:49
Phone Contact List with Dictionary in Python3
#!/bin/python3
import sys
if __name__ == '__main__':
n = int(input())
m = 1
i=0
dic = {}
for i in range (n):
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic string exercises
# Fill in the code for the functions below. main() is already set up
# F. front_back
# Consider dividing a string into two halves.
# If the length is even, the front and back halves are the same length.
# If the length is odd, we'll say that the extra char goes in the front half.
# e.g. 'abcde', the front half is 'abc', the back half 'de'.
# Given 2 strings, a and b, return a string of the form
# a-front + b-front + a-back + b-back
def front_back(a, b):
af = len(a)//2
#!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
# Basic list exercises
# Fill in the code for the functions below. main() is already set up
@Nditah
Nditah / gist:29258f24f2867abedbb67db12a2cf885
Created October 15, 2018 09:11 — forked from jkubacki/gist:e2dd904bd648b0bd4554
Mac uninstall elasticsearch
#!/usr/bin/env sh
# checks to see if running
launchctl list | grep elasticsearch
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl remove homebrew.mxcl.elasticsearch
pkill -f elasticsearch
@Nditah
Nditah / setting-up-babel-nodemon.md
Created November 18, 2018 14:39 — forked from fega/setting-up-babel-nodemon.md
Setting up Babel and nodemon

Setting up Babel and nodemon

Inital set-up

Set up project:

mkdir project
cd project
npm init -y
@Nditah
Nditah / gist:e927d9b0b91a9549daa01b8973879393
Created November 30, 2018 02:55 — forked from paulallies/gist:0052fab554b14bbfa3ef
Remove node_modules from git repo
#add 'node_modules' to .gitignore file
git rm -r --cached node_modules
git commit -m 'Remove the now ignored directory node_modules'
git push origin master
@Nditah
Nditah / PythonSetup.md
Created April 5, 2019 08:49 — forked from patriciogonzalezvivo/PythonSetup.md
How to install Python correctly on Mac OSX

Install Homebrew

ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"

Add PATH to ~/.bash_profile and ~/.zshrc

export PATH=/usr/local/bin:$PATH
@Nditah
Nditah / MySql-5.5-installation guide.md
Created November 11, 2019 19:53 — forked from ahmadhasankhan/MySql-5.5-installation guide.md
Install MySQL 5.5.xx on Ubuntu

MySQL Download URL

https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.56-linux-glibc2.5-x86_64.tar.gz

Open the terminal and follow along:

  • Uninstall any existing version of MySQL
sudo rm /var/lib/mysql/ -R
@Nditah
Nditah / nginxproxy.md
Created September 29, 2020 13:39 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers