Last active
April 25, 2017 00:06
-
-
Save levidurfee/a19e811dcd7df10c4da0931641538497 to your computer and use it in GitHub Desktop.
Gist with multiple files, different languages, and more code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
printf("Hello World\n"); | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Hiiii"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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