Skip to content

Instantly share code, notes, and snippets.

Abstract - Week 1 Training Guide

Combine volition oriented teaching techniques with useful code snippets to provide students the toolset required to achieve fast results and set them on the path towards independence.

"Choose between measurement-based management and delegatory management (where the doers decide how to do the work). Measurement-based management is best suited to repetitive simple work, with low knowledge requirements and easily measured outputs - exactly the opposite of software development." - Martin Fowler

Demo Sessions

Brainstorm together with students for a project proposal of similar scope (but reduced complexity) to their own assigned projects, and introduce syntax, library APIs, and conceptual knowledge only when relevant to the context of the project. Aim to limit coding to the most basic prototype, discovering issues along the way, and solving problems as they occur.

Mob Programming

As the driver, ask students to pitch and discuss ideas, features, and decisions. Outline go

@MehrabRahman
MehrabRahman / Calculator.java
Created August 6, 2020 16:52
JankUnit example
public class Calculator {
public int add(int a, int b) {
return a + b;
}
public int sub(int a, int b) {
return a - b;
}
}
@MehrabRahman
MehrabRahman / App.java
Last active June 5, 2021 19:21
Poor Man's HTTP server
public class App {
public static void main(String[] args) {
Server server = new Server(8080);
server.addController("/hello", (request, response) -> {
String name;
name = request.getParameter("name");
if (name == null)
name = "World";
response.setStatus(200, "Ok");
@MehrabRahman
MehrabRahman / HelloClient.java
Last active October 14, 2022 14:31
Easy SOAP
package com.mehrabr;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
public class HelloClient {
@MehrabRahman
MehrabRahman / EmbeddedServer.java
Created June 6, 2020 05:38
No-JSP Embedded Tomcat
import java.io.File;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
import org.apache.catalina.startup.Tomcat;
public class EmbeddedServer {
public static void main(String[] args) throws LifecycleException {
Tomcat server = new Tomcat();
@MehrabRahman
MehrabRahman / EmbeddedRestDemo.java
Last active July 2, 2020 17:30
Minimalist, Programmatic Spring MVC
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRegistration.Dynamic;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.WebApplicationInitializer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.ContextLoaderListener;