Skip to content

Instantly share code, notes, and snippets.

View avermeulen's full-sized avatar

Andre Vermeulen avermeulen

  • project codeX
  • Cape Town, South Africa
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="counter"></div>
<input type="text" class="name" pattern="^[A-Za-z]*" >
@avermeulen
avermeulen / AppleStockCount.java
Last active July 12, 2019 10:19
A small challenge at codeX about conditional statements while preparing for the OCA exam.
public class AppleStockCount {
public static void main(String[] args) {
if (args.length == 0) {
System.out.println("Please give me a qty!");
return;
}
int qty = Integer.parseInt(args[0]);
double cost = 4.50;

Tutor finder

This app help learners to find a tutor that you fits their pocket.

It's simple for tutors to get going. Select a subject to tutor, your hourly rate and your name and your ready to go.

This app will store it's data in PostgreSQL. And it will be an ExpressJS web app.

Create new folder called tutor-finder. Change into it. Open the folder in VS Code.

package net.greet.web;
import java.math.BigDecimal;
import java.math.RoundingMode;
public class CompoundInterest {
public static void main(String[] args) {
double pv = 28000;
double interestRate = 7/100d;
@avermeulen
avermeulen / spark-workshop.md
Last active May 14, 2019 13:15
SparkJava in a flash.

Spark Java workshop

Create a new maven project in IntelliJ called MyFirstJavaWebApp (ArtifactId) use a root package name of - net.myfirst.webapp (GroupId).

Configure SparkJava in your project using maven:

http://sparkjava.com/documentation#getting-started

@avermeulen
avermeulen / random_fruits.js
Created March 15, 2019 10:52
Create list of random fruits to help explaining concepts
const fruits = [
'apples',
'pears',
'grapes',
'peaches',
'oranges'
];
var list = [];
@avermeulen
avermeulen / Main.java
Last active March 4, 2019 15:37
Examples using constructors using Java
class Person {
private String lastName;
private String firstName;
public Person(String firstName) {
this.firstName = firstName;
}

Teachers, Learners & Lessons

Learn more about Java Objects using Teachers, Learners, Lessons & Tokens.

A short programming exercise to practice using Classes

A person has a firstName, lastName & email address.

Teachers & Students

VueJS intro

Clone the dom-intro repository in your projects folder into a folder called vuejs-intro

git clone https://github.com/codex-academy/dom-intro vuejs-intro

Remember to link this to a repository of your own later.

function buildQuery(sql, fields) {
// get all the fields needed in the where clause
let field_names = Object.keys(fields);
// check if a where clause is needed
if (field_names.length > 0) {
sql += ' where '