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 / concurrency.java
Created October 26, 2015 21:41 — forked from anonymous/concurrency.java
Demonstrate concurrency using timer.
package supercat1;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*; // Using Swing components and containers
import java.util.Timer
// A Swing application extends javax.swing.JFrame
public class supercat1 extends JFrame {
private JTextField tfCount;
// Use Swing's JTextField instead of AWT's TextField
@Timtech4u
Timtech4u / index.html
Created May 17, 2017 03:38
Vue-Resource & JSONPlaceholder Example
<div id="vueApp">
<header>
<div class="wrapper">
<h1>Vue-Resource</h1>
<a href="#" class="btn" @click.stop="loadUsers">Load Users</a>
</div>
</header>
<div class="posts">
@Timtech4u
Timtech4u / index.html
Created May 17, 2017 03:38
Vue.JS - Advanced Data Grid Component
<script type="text/x-template" id="dropdown-template">
<div class="dropdown" v-show="show" v-bind:class="originClass" transition="dropdown">
<slot>No dropdown content!</slot>
</div>
</script>
<script type="text/x-template" id="datagrid-template">
<table id="{{ id }}" class="table-striped datagrid">
<thead>
<tr>
@Timtech4u
Timtech4u / emailer.py
Created June 5, 2017 23:21 — forked from sarahholderness/emailer.py
Python scripts to read a list of customer emails and send an email with the daily weather forecast
import weather
import smtp
'''
Send a greeting email to our customer email list
with the daily weather forecast and schedule
'''
def get_emails():
# Reading emails from a file
@Timtech4u
Timtech4u / cors.py
Created August 21, 2017 08:46 — forked from miraculixx/cors.py
To enable CORS support in django-tastypie, use the following code snipet. Then create your tastypie resources as a subclass of BaseCorsResource.Basic code courtesy Daniel Conzalez of http://codeispoetry.me/index.php/make-your-django-tastypie-api-cross-domain/.I added documentation and the post_list method.
'''
Add CORS headers for tastypie APIs
Usage:
class MyModelResource(CORSModelResource):
...
class MyResource(CORSResource):
...
@Timtech4u
Timtech4u / VueAxios.html
Last active August 28, 2017 10:57
A Simple API call using Vue.js and Axios
<!DOCTYPE html>
<html>
<head>
<title>Vue Axios Example</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.4.2/vue.js"></script>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
</head>
<body>
<div id="app">
<ul>
@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 {