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 / freePort8000.sh
Created September 13, 2017 23:25
Script to kill process running on port 8000
kill -9 $(lsof -i TCP:8000 | grep LISTEN | awk '{print $2}')
@Timtech4u
Timtech4u / FirebaseToFirestore.js
Created November 24, 2017 10:36 — forked from JoeRoddy/FirebaseToFirestore.js
Convert Firebase Database JSON to Firestore Collections
var db = firebase.firestore();
var content = require("./sourceData.json");
content &&
Object.keys(content).forEach(contentKey => {
const nestedContent = content[contentKey];
if (typeof nestedContent === "object") {
Object.keys(nestedContent).forEach(docTitle => {
firebase
.firestore()
@Timtech4u
Timtech4u / .html
Created June 13, 2018 10:44
ALCKanoMeetup2
<!DOCTYPE html>
<html>
<head>
<title>My Web Page</title>
<style>
.sizeb {
font-size: 50px;
}
.colory {
@Timtech4u
Timtech4u / senatorial.json
Created June 16, 2018 17:18
Nigeria Senatorial Districts
{
"AbiaNorth":[
"Umonneochi",
"Isukwuato",
"Ohafia",
"Arochukwu",
"Bende"
],
"AbiaCentral":[
"Umuahia North",
@Timtech4u
Timtech4u / main.dart
Created June 29, 2018 04:01
Flutter Http Get
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:http/http.dart' as http;
import 'dart:convert';
void main() {
runApp(new MaterialApp(
home: new MyGetHttpData(),
));
}
@Timtech4u
Timtech4u / feed_fetch.php
Created September 22, 2018 03:16
Fetching feeds from wordpress
<?php
$rss = new DOMDocument();
$rss->load('https://glamdfaces.wordpress.com/feed');
$feed = array();
foreach ($rss->getElementsByTagName('item') as $node) {
$item = array (
'title' => $node->getElementsByTagName('title'),
'desc' => $node->getElementsByTagName('description'),
'link' => $node->getElementsByTagName('link'),
@Timtech4u
Timtech4u / sen.py
Created September 24, 2018 14:54
Longest string
def LongestWord(sen):
sen = sen.split()
sen = max(sen, key=len)
# code goes here
return sen
# keep this function call here
print LongestWord(raw_input())
@Timtech4u
Timtech4u / time.py
Created September 24, 2018 16:09
12hr to 24hr in Python
def timeConversion(s):
time = s
if time[-2:] == "AM" and time[:2] == "12":
return "00"+time[2:-2]
elif time[-2:] == "AM":
return time[:-2]
elif time[-2:] == "PM" and time[:2] == "12":
return time[:-2]
else:
return str(int(time[:2]) + 12) + time[2:8]
@Timtech4u
Timtech4u / routes.js
Created September 24, 2018 17:19
Vuejs ACL Using Firebase Auth + Vue Router
//1. Can be used in Navbar/base filr
import firebase from 'firebase';
export default {
name: 'navbar',
data() {
return {
isLoggedIn: false,
currentUser: false
};
},
@Timtech4u
Timtech4u / Procfile
Created January 4, 2019 12:09
Deploying Django
web: gunicorn <project_name.wsgi>