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 / bday.py
Created November 12, 2016 23:35
Happy Birthday Codes in Python.
#!/usr/bin/python
import curses
import random
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)
curses.halfdelay(1)
@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 / index.html
Created August 30, 2017 01:12
vuejs firebase list
<div id="app">
<h2>Firebase List</h2>
<div v-for="item in items" class="item">
<button @click="removeItem(item)">&times;</button> {{item.value}} <small>{{new Date(item.ts).toGMTString()}}</small>
</div>
<div>
<form><input v-model="tempItem"><button @click="addItem(tempItem); tempItem = ''" :disabled="tempItem===''"> + </button> </form>
</div>
</div>
@Timtech4u
Timtech4u / DeployAPIJs.md
Last active September 11, 2018 18:33 — forked from Yogendra0Sharma/README.md
Setting up a Dockerized web application with Django REST APIs, ReactJS with Redux pattern, and Webpack Hot Reloading! Mouthful.

Guide on how to create and set up a Dockerized web app using Django REST APIs and ReactJS

Hopefully this will answer "How do I setup or start a Django project using REST Framework and ReactJS?"

I created this because it was SUCH a pain in the ass setting up a project using all the latest technologies. After some research, I figured it out and have it working. The repo that implements this is located here. Feel free to use it as a boilerplate ;)

Main features:

  • Django REST APIs
  • ReactJS with Redux Pattern
  • Webpack module bundler manager