Skip to content

Instantly share code, notes, and snippets.

View akleemans's full-sized avatar

Adrianus Kleemans akleemans

View GitHub Profile
@akleemans
akleemans / index.html
Last active November 8, 2016 13:02
An example AngularJS page with some basic angular components
<html>
<head>
<title>Example page</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular-resource.min.js"></script>
</head>
<body ng-app="ExampleApp">
<div ng-controller="ExampleController as exampleCtrl">
<h2>Users</h2>
<p>Here's a list of users and their email providers.</p>
@akleemans
akleemans / server.py
Last active January 15, 2020 12:25
Simple development web in Python for serving static files
from flask import Flask, send_from_directory
app = Flask(__name__)
@app.route('/<path:path>')
def send_files(path):
return send_from_directory('static', path)
if __name__ == "__main__":
app.run()
import Tkinter
import tkMessageBox
total = 0
EasyBox1 = Tkinter.Tk()
EasyBox1.geometry("250x200")
EasyBox1.title("Quesion 1")
EasyBox2 = Tkinter.Tk()
EasyBox2.geometry("250x200")
<!DOCTYPE html>
<html lang="en" ng-app="TodolistApp">
<head>
<title>Todolist app</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<body>
<script>
@akleemans
akleemans / pom.xml
Last active February 11, 2016 10:55
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Todolist</groupId>
<artifactId>Todolist</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<sourceDirectory>src</sourceDirectory>
<plugins>
@akleemans
akleemans / web.xml
Last active February 11, 2016 08:28
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<display-name>Todolist</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Resource name="jdbc/todolist" auth="Container" type="javax.sql.DataSource" maxActive="100" maxIdle="30"
maxWait="10000" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/todolist"
username="todolist_user" password="J4k-pa3$?%-u" />
<ResourceLink name="jdbc/todolist" global="jdbc/todolist" type="javax.sql.DataSource" />
</Context>
package tasks;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import javax.naming.Context;
package tasks;
import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement
public class Task {
private int id;
private String description;
private int urgency;
private String user_name;
CREATE DATABASE todolist;
USE todolist;
CREATE TABLE user (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(30),
lastname VARCHAR(30)
);