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
{ | |
"coord": { | |
"lon": 113.546112, | |
"lat": 22.20056 | |
}, | |
"sys": { | |
"country": "MO", | |
"sunrise": 1383690767, | |
"sunset": 1383731168 | |
}, |
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 | |
// DATA | |
$passwords = [ | |
"John" => "1357", | |
"Susan" => "2468", | |
"Steven" => "1890", | |
"Steve" => "9876" | |
]; |
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 | |
// DATA | |
$questions=[]; | |
$questions[] = [ | |
"q" => "1+2", | |
"ans" => "3" | |
]; | |
$questions[] = [ | |
"q" => "3x5", | |
"ans" => "15" |
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 | |
// DATA | |
$students = []; | |
$students[] = [ | |
"name" => "Thomas Mak", | |
"class" => "S1A", | |
"number" => 32, | |
"enrolled_classes" => [ | |
"Chinese", |
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
<title> | |
WebCode.run Editor | |
</title> | |
<style> | |
* { box-sizing: border-box; } | |
html, body { | |
margin: 0; | |
padding: 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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule ^(.*)$ public/$1 [L] | |
</IfModule> |
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
let key = "<YOUR-KEY>" | |
let parameters = [ | |
"from": "<FROM-EMAIL>", | |
"to": "<TO-EMAIL>", | |
"subject": "<SUBJECT>", | |
"text": "<CONTENT>" | |
] | |
let r = Alamofirerequest(.POST, "https://api.mailgun.net/v3/<MAILGUN-DOMAIN>/messages", parameters:parameters) |
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 App { | |
constructor() { | |
this.canvas = document.getElementById("app-canvas"); | |
this.stage = new createjs.Stage(this.canvas); | |
this.retinalize(); | |
createjs.Ticker.setFPS(60); |
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 | |
session_id("thomas23"); | |
session_start(); | |
// initialize the login name session variable. | |
$_SESSION["login_name"] = $_SESSION["login_name"] ?? ""; | |
// there is data POST from user. | |
if (count($_POST) > 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
<?php | |
session_id("thomas23"); | |
session_start(); | |
if (!isset($_SESSION["q_num"]) ){ | |
$_SESSION["q_num"] = 0; | |
} |