Skip to content

Instantly share code, notes, and snippets.

View Timtech4u's full-sized avatar
🎯
Focusing

Timothy Olaleke Timtech4u

🎯
Focusing
View GitHub Profile
@Timtech4u
Timtech4u / kano.geojson
Last active March 14, 2019 15:55
Kano's GeoJSON Feature Point
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Timtech4u
Timtech4u / contact.html
Created March 9, 2019 23:58
Contact Page for Personal Website
---
layout: default
---
<div class="typeform-widget" data-url="https://timothyolaleke.typeform.com/to/SG6ad8" style="width: 100%; height: 500px;"></div> <script> (function() { var qs,js,q,s,d=document, gi=d.getElementById, ce=d.createElement, gt=d.getElementsByTagName, id="typef_orm", b="https://embed.typeform.com/"; if(!gi.call(d,id)) { js=ce.call(d,"script"); js.id=id; js.src=b+"embed.js"; q=gt.call(d,"script")[0]; q.parentNode.insertBefore(js,q) } })() </script>
@Timtech4u
Timtech4u / _config.yaml
Created March 9, 2019 22:40
My Github Personal Website Configuration
layout: stacked
style: dark
plugins:
- jekyll-octicons
- jekyll-github-metadata
- jemoji
permalink: /:year/:month/:day/:title/
@Timtech4u
Timtech4u / dps.jinja
Last active July 29, 2020 13:21
Firewall and a Startup Script with Deployment Manager
imports:
- path: install-web.sh
name: install-web.sh
resources:
- name: default-allow-http
type: compute.v1.firewall
properties:
sourceRanges: ["0.0.0.0/0"]
targetTags: ["http-server"]
allowed:
command usage
git init Creates an empty Git repository in the specified directory.
git clone <repository name> Clones a repository located at <repository name> onto your local machine.
git add <directory> Stages only the specified changes for the next commit. Replace <directory> with a <file> to change a specific file.
git add . Stages new files and modifications without deletions
git add -A Stages all changes
git add -all Equivalent to git add -A
git add -u Stages modifications and deletions without adding new files
git add --update Equivalent to git add -u
git commit -m ”<message>” Commits the staged snapshot. replace <message> with the commit message.
@Timtech4u
Timtech4u / Renamer.py
Created February 12, 2019 15:03
A simple script to rename .pdf files based off a CSV lookup file (containing the name for their codes)
import os, csv
# Define paths and variables to be used
currentPath = os.getcwd()
csvFieName = 'LookUpTable.csv'
csvFilePath = os.path.join(currentPath, csvFieName)
locationInfo = {}
# Read locations into locationInfo with locationCode => locationName
with open(csvFilePath) as csvFile:
# Function that listens to USSD
@csrf_exempt
@require_POST
def process_listen(request):
user_choice = None
state_choice = None
state_id = None
total_locations = Units.objects.all().count()
@Timtech4u
Timtech4u / pg.js
Last active January 14, 2019 09:21
Connect to PG DB via Node
const { Client } = require('pg')
let datasets = []
const Data = () => {
return new Promise(resolve => {
// Connect to PG DB to get MarketPoints
const client = new Client({
user: config.database.user,
host: config.database.host,
<form method="post">
{% csrf_token %}
{% for field in form %}
<p>
{{ field }}
{% for error in field.errors %}
<p style="color: red">{{ error }}</p>
{% endfor %}
</p>
{% endfor %}
@Timtech4u
Timtech4u / Procfile
Created January 4, 2019 12:09
Deploying Django
web: gunicorn <project_name.wsgi>