Skip to content

Instantly share code, notes, and snippets.

@levidurfee
Last active April 25, 2017 00:06
Show Gist options
  • Save levidurfee/a19e811dcd7df10c4da0931641538497 to your computer and use it in GitHub Desktop.
Save levidurfee/a19e811dcd7df10c4da0931641538497 to your computer and use it in GitHub Desktop.
Gist with multiple files, different languages, and more code
class Greeter {
greeting: string;
constructor(message: string) {
this.greeting = message;
}
greet() {
return "Hello, " + this.greeting;
}
}
let greeter = new Greeter("world");
let button = document.createElement('button');
button.textContent = "Say Hello";
button.onclick = function() {
alert(greeter.greet());
}
document.body.appendChild(button);
#include <stdio.h>
int main()
{
printf("Hello World\n");
return 0;
}
<!DOCTYPE html>
<html>
<head>
<title>hi world!</title>
</head>
<body>
<p>It is me, a gist iframe in AMP!</p>
<script src="index.js"></script>
</body>
</html>
console.log("Hiiii");
<?php
class Route {
public $method;
public $path;
public function __construct($method, $path) {
$this->method = $method;
$this->path = $path;
}
public static function create($method, $path) {
return new Route($method, $path);
}
}
class Router {
private $routes;
public function __construct() {
// . . .
}
public function add(Route $route) {
$this->routes[md5($route)]['method'] = $route->method;
$this->routes[md5($route)]['path'] = $route->path;
}
/*
. . .
*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment