Skip to content

Instantly share code, notes, and snippets.

View elliotforbes's full-sized avatar
:octocat:

Elliot Forbes elliotforbes

:octocat:
View GitHub Profile
from flask import Flask
import os
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World"
if __name__ == "__main__":
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class Server {
public static void main(String[] args) throws Exception {
FROM java:8
COPY Server.java /
RUN javac Server.java
EXPOSE 8080
ENTRYPOINT ["java"]
CMD ["server"]
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class PingPong {
public static void main(String[] args) throws Exception {
FROM golang:latest
RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN go build -o main .
CMD ["/app/main"]
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
<html ng-app="testApp">
<head>
<title>AngularJS ng-if child scopes example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>
</head>
<body ng-controller="testController">
<h2>Directives Tutorial</h2>
<mydir></mydir>
var testApp = angular.module('testApp', []);
testApp.directive('mydir', function () {
return {
template: 'This is my directive'
};
});
<h2>Home Page</h2>
<ul>
<li><a href="#/category/apple">Apple Products</a></li>
<li><a href="#/category/microsoft">Microsoft Products</a></li>
</ul>
public abstract class Enemy {
double health;
int ammo;
public abstract void attack();
public Double getHealth(){
return this.health;
}