Compare commits
No commits in common. '4a142fdff423de6a79caf45da098ed61e6b00013' and 'abc9e1d3865adae531706882a384e22247be6521' have entirely different histories.
4a142fdff4
...
abc9e1d386
26 changed files with 111501 additions and 107 deletions
@ -0,0 +1,2 @@ |
||||
alias.conf |
||||
node_modules |
@ -0,0 +1,33 @@ |
||||
const mysql = require("mysql2"); |
||||
const fs = require("fs"); |
||||
|
||||
require('dotenv').config({ |
||||
path: '../../.env' |
||||
}); |
||||
|
||||
let conn = mysql.createConnection({ |
||||
host: 'localhost', |
||||
port: process.env.MYSQL_PORT, |
||||
user: process.env.MYSQL_USER, |
||||
password: process.env.MYSQL_PASSWORD, |
||||
database: 'website' |
||||
}); |
||||
|
||||
conn.connect(); |
||||
|
||||
conn.query("SELECT name FROM projects WHERE visible=1", (err, results) => { |
||||
let names = results.map(res => res.name); |
||||
|
||||
let fileContent = ""; |
||||
|
||||
// Aliases
|
||||
for (let name of names) |
||||
fileContent += `Alias /${name} \${ProjectsPath}/${name}\n` |
||||
|
||||
// Allow access
|
||||
fileContent += '<Directory ~ \"^${ProjectsPath}/(' + names.join("|") + ')\">\n\tRequire all granted\n</Directory>' |
||||
|
||||
fs.writeFileSync("./alias.conf", fileContent); |
||||
}) |
||||
|
||||
conn.end(); |
@ -0,0 +1,254 @@ |
||||
{ |
||||
"name": "update-apache", |
||||
"version": "1.0.0", |
||||
"lockfileVersion": 2, |
||||
"requires": true, |
||||
"packages": { |
||||
"": { |
||||
"name": "update-apache", |
||||
"version": "1.0.0", |
||||
"license": "ISC", |
||||
"dependencies": { |
||||
"dotenv": "^16.0.3", |
||||
"mysql2": "^2.3.3" |
||||
} |
||||
}, |
||||
"node_modules/denque": { |
||||
"version": "2.1.0", |
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", |
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==", |
||||
"engines": { |
||||
"node": ">=0.10" |
||||
} |
||||
}, |
||||
"node_modules/dotenv": { |
||||
"version": "16.0.3", |
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", |
||||
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==", |
||||
"engines": { |
||||
"node": ">=12" |
||||
} |
||||
}, |
||||
"node_modules/generate-function": { |
||||
"version": "2.3.1", |
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", |
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", |
||||
"dependencies": { |
||||
"is-property": "^1.0.2" |
||||
} |
||||
}, |
||||
"node_modules/iconv-lite": { |
||||
"version": "0.6.3", |
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", |
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", |
||||
"dependencies": { |
||||
"safer-buffer": ">= 2.1.2 < 3.0.0" |
||||
}, |
||||
"engines": { |
||||
"node": ">=0.10.0" |
||||
} |
||||
}, |
||||
"node_modules/is-property": { |
||||
"version": "1.0.2", |
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", |
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" |
||||
}, |
||||
"node_modules/long": { |
||||
"version": "4.0.0", |
||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", |
||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" |
||||
}, |
||||
"node_modules/lru-cache": { |
||||
"version": "6.0.0", |
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", |
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", |
||||
"dependencies": { |
||||
"yallist": "^4.0.0" |
||||
}, |
||||
"engines": { |
||||
"node": ">=10" |
||||
} |
||||
}, |
||||
"node_modules/mysql2": { |
||||
"version": "2.3.3", |
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", |
||||
"integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", |
||||
"dependencies": { |
||||
"denque": "^2.0.1", |
||||
"generate-function": "^2.3.1", |
||||
"iconv-lite": "^0.6.3", |
||||
"long": "^4.0.0", |
||||
"lru-cache": "^6.0.0", |
||||
"named-placeholders": "^1.1.2", |
||||
"seq-queue": "^0.0.5", |
||||
"sqlstring": "^2.3.2" |
||||
}, |
||||
"engines": { |
||||
"node": ">= 8.0" |
||||
} |
||||
}, |
||||
"node_modules/named-placeholders": { |
||||
"version": "1.1.2", |
||||
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", |
||||
"integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", |
||||
"dependencies": { |
||||
"lru-cache": "^4.1.3" |
||||
}, |
||||
"engines": { |
||||
"node": ">=6.0.0" |
||||
} |
||||
}, |
||||
"node_modules/named-placeholders/node_modules/lru-cache": { |
||||
"version": "4.1.5", |
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", |
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", |
||||
"dependencies": { |
||||
"pseudomap": "^1.0.2", |
||||
"yallist": "^2.1.2" |
||||
} |
||||
}, |
||||
"node_modules/named-placeholders/node_modules/yallist": { |
||||
"version": "2.1.2", |
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", |
||||
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" |
||||
}, |
||||
"node_modules/pseudomap": { |
||||
"version": "1.0.2", |
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", |
||||
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" |
||||
}, |
||||
"node_modules/safer-buffer": { |
||||
"version": "2.1.2", |
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", |
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" |
||||
}, |
||||
"node_modules/seq-queue": { |
||||
"version": "0.0.5", |
||||
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", |
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" |
||||
}, |
||||
"node_modules/sqlstring": { |
||||
"version": "2.3.3", |
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", |
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==", |
||||
"engines": { |
||||
"node": ">= 0.6" |
||||
} |
||||
}, |
||||
"node_modules/yallist": { |
||||
"version": "4.0.0", |
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", |
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" |
||||
} |
||||
}, |
||||
"dependencies": { |
||||
"denque": { |
||||
"version": "2.1.0", |
||||
"resolved": "https://registry.npmjs.org/denque/-/denque-2.1.0.tgz", |
||||
"integrity": "sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==" |
||||
}, |
||||
"dotenv": { |
||||
"version": "16.0.3", |
||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.3.tgz", |
||||
"integrity": "sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ==" |
||||
}, |
||||
"generate-function": { |
||||
"version": "2.3.1", |
||||
"resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.3.1.tgz", |
||||
"integrity": "sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==", |
||||
"requires": { |
||||
"is-property": "^1.0.2" |
||||
} |
||||
}, |
||||
"iconv-lite": { |
||||
"version": "0.6.3", |
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", |
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", |
||||
"requires": { |
||||
"safer-buffer": ">= 2.1.2 < 3.0.0" |
||||
} |
||||
}, |
||||
"is-property": { |
||||
"version": "1.0.2", |
||||
"resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", |
||||
"integrity": "sha512-Ks/IoX00TtClbGQr4TWXemAnktAQvYB7HzcCxDGqEZU6oCmb2INHuOoKxbtR+HFkmYWBKv/dOZtGRiAjDhj92g==" |
||||
}, |
||||
"long": { |
||||
"version": "4.0.0", |
||||
"resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", |
||||
"integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" |
||||
}, |
||||
"lru-cache": { |
||||
"version": "6.0.0", |
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", |
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", |
||||
"requires": { |
||||
"yallist": "^4.0.0" |
||||
} |
||||
}, |
||||
"mysql2": { |
||||
"version": "2.3.3", |
||||
"resolved": "https://registry.npmjs.org/mysql2/-/mysql2-2.3.3.tgz", |
||||
"integrity": "sha512-wxJUev6LgMSgACDkb/InIFxDprRa6T95+VEoR+xPvtngtccNH2dGjEB/fVZ8yg1gWv1510c9CvXuJHi5zUm0ZA==", |
||||
"requires": { |
||||
"denque": "^2.0.1", |
||||
"generate-function": "^2.3.1", |
||||
"iconv-lite": "^0.6.3", |
||||
"long": "^4.0.0", |
||||
"lru-cache": "^6.0.0", |
||||
"named-placeholders": "^1.1.2", |
||||
"seq-queue": "^0.0.5", |
||||
"sqlstring": "^2.3.2" |
||||
} |
||||
}, |
||||
"named-placeholders": { |
||||
"version": "1.1.2", |
||||
"resolved": "https://registry.npmjs.org/named-placeholders/-/named-placeholders-1.1.2.tgz", |
||||
"integrity": "sha512-wiFWqxoLL3PGVReSZpjLVxyJ1bRqe+KKJVbr4hGs1KWfTZTQyezHFBbuKj9hsizHyGV2ne7EMjHdxEGAybD5SA==", |
||||
"requires": { |
||||
"lru-cache": "^4.1.3" |
||||
}, |
||||
"dependencies": { |
||||
"lru-cache": { |
||||
"version": "4.1.5", |
||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", |
||||
"integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", |
||||
"requires": { |
||||
"pseudomap": "^1.0.2", |
||||
"yallist": "^2.1.2" |
||||
} |
||||
}, |
||||
"yallist": { |
||||
"version": "2.1.2", |
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", |
||||
"integrity": "sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==" |
||||
} |
||||
} |
||||
}, |
||||
"pseudomap": { |
||||
"version": "1.0.2", |
||||
"resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", |
||||
"integrity": "sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==" |
||||
}, |
||||
"safer-buffer": { |
||||
"version": "2.1.2", |
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", |
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" |
||||
}, |
||||
"seq-queue": { |
||||
"version": "0.0.5", |
||||
"resolved": "https://registry.npmjs.org/seq-queue/-/seq-queue-0.0.5.tgz", |
||||
"integrity": "sha512-hr3Wtp/GZIc/6DAGPDcV4/9WoZhjrkXsi5B/07QgX8tsdc6ilr7BFM6PM6rbdAX1kFSDYeZGLipIZZKyQP0O5Q==" |
||||
}, |
||||
"sqlstring": { |
||||
"version": "2.3.3", |
||||
"resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.3.tgz", |
||||
"integrity": "sha512-qC9iz2FlN7DQl3+wjwn3802RTyjCx7sDvfQEXchwa6CWOx07/WVfh91gBmQ9fahw8snwGEWU3xGzOt4tFyHLxg==" |
||||
}, |
||||
"yallist": { |
||||
"version": "4.0.0", |
||||
"resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", |
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,15 @@ |
||||
{ |
||||
"name": "update-apache", |
||||
"version": "1.0.0", |
||||
"description": "Create Apache2 Alias directives based on projects database", |
||||
"main": "index.js", |
||||
"scripts": { |
||||
"start": "node index.js" |
||||
}, |
||||
"author": "Benjamin Kraft", |
||||
"license": "ISC", |
||||
"dependencies": { |
||||
"dotenv": "^16.0.3", |
||||
"mysql2": "^2.3.3" |
||||
} |
||||
} |
@ -0,0 +1,2 @@ |
||||
#!/usr/bin/bash |
||||
sudo service apache2 restart |
@ -0,0 +1,38 @@ |
||||
<?php |
||||
|
||||
class MySQLConnection { |
||||
|
||||
private int $port; |
||||
private string $host; |
||||
private string $user; |
||||
private string $pass; |
||||
private string $dbName = "all_projects"; |
||||
private mysqli $mysqli; |
||||
|
||||
public function __construct() { |
||||
$config = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/../secrets/mysql.ini'); |
||||
$this->host = $config['host']; |
||||
$this->port = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/../env_config.ini')['local_mysql_port']; |
||||
$this->user = $config['username']; |
||||
$this->pass = $config['password']; |
||||
$this->createConn(); |
||||
} |
||||
|
||||
private function createConn() { |
||||
$this->mysqli = new mysqli($this->host . ":" . $this->port, $this->user, $this->pass, $this->dbName); |
||||
} |
||||
|
||||
public function query($sql) { |
||||
return $this->mysqli->query($sql); |
||||
} |
||||
|
||||
public function changeDB($dbName) { |
||||
$this->dbName = $dbName; |
||||
$this->mysqli->select_db($dbName); |
||||
} |
||||
|
||||
public function __destruct() { |
||||
$this->mysqli->close(); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<script src="/lib/socket.io/socket.io.min.js" type="text/javascript"></script> |
||||
<script src="/lib/jquery/jquery.min.js" type="text/javascript"></script> |
||||
<script src="/lib/p5/p5.min.js" type="text/javascript"></script> |
||||
<script src="index_data/init.js" type="text/javascript"></script> |
||||
<link href="styles.css" rel="stylesheet"> |
||||
<link href="favicon.ico" rel="icon" type="image/x-icon"> |
||||
<title>Benjamin Kraft: Games</title> |
||||
</head> |
||||
<body> |
||||
<div id="content"> |
||||
<h1>Benjamin Kraft: Games</h1> |
||||
<div id="site-description"> |
||||
<p>Hi, here you can find some games I wrote with Javascript, Typescript or C#</p> |
||||
</div> |
||||
<div id="projects-container"></div> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -1,60 +0,0 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<link href="styles.css" rel="stylesheet"> |
||||
<title>Benjamin Kraft: Games</title> |
||||
</head> |
||||
<body> |
||||
<div id="content"> |
||||
<h1>Benjamin Kraft: Games</h1> |
||||
<div id="projects-container"> |
||||
<?php |
||||
require "php/mysql_connect.php"; |
||||
$conn = new MySQLConnection(); |
||||
|
||||
|
||||
|
||||
$tag = array_key_exists("tag", $_GET) ? $conn->escape($_GET["tag"]) : null; |
||||
$sort = array_key_exists("sort", $_GET) ? $_GET["sort"] : "0"; |
||||
$queryFiltered = |
||||
<<<SQL |
||||
SELECT P.name, P.display_name, P.version, P.info, P.date_updated |
||||
FROM projects P INNER JOIN project_tags PT ON P.name=PT.project_name |
||||
WHERE visible=1 AND PT.tag_name='$tag' |
||||
ORDER BY date_updated DESC |
||||
SQL; |
||||
|
||||
$queryUnfiltered = |
||||
<<<SQL |
||||
SELECT name, display_name, version, info_text, date_updated |
||||
FROM projects |
||||
WHERE visible=1 |
||||
ORDER BY date_updated DESC |
||||
SQL; |
||||
|
||||
$result = $conn->query($queryUnfiltered); |
||||
while ($row = $result->fetch_assoc()) { |
||||
$name = $row["name"]; |
||||
$displayName = $row["display_name"]; |
||||
$version = $row["version"]; |
||||
$info = $row["info_text"]; |
||||
$dateUpdated = $row["date_updated"]; |
||||
|
||||
$imgAddress = "/projects/$name/thumbnail.png"; |
||||
|
||||
$nameDom = "<h3 class='project-name'>$displayName</h3>"; |
||||
$versionDom = "<h4 class='project-version'>$version</h4>"; |
||||
$infoDom = "<div class='project-info'>$info</div>"; |
||||
$startDom = "<button class='project-start' onclick='window.location = \"projects/$name/\"'>Start</button>"; |
||||
|
||||
$imgDom = "<img class='project-image' src='$imgAddress' alt='Alternative image text'/>"; |
||||
$descriptionDom = "<div class='project-description'>$nameDom$versionDom$infoDom$startDom</div>"; |
||||
|
||||
echo "<div class='project'>$imgDom$descriptionDom</div>"; |
||||
} |
||||
?> |
||||
</div> |
||||
</div> |
||||
</body> |
||||
</html> |
@ -0,0 +1,253 @@ |
||||
{ |
||||
"languages": [ |
||||
{ |
||||
"displayName": "JavaScript", |
||||
"name": "javascript", |
||||
"id": 0 |
||||
}, |
||||
{ |
||||
"displayName": "TypeScript", |
||||
"name": "typescript", |
||||
"id": 1 |
||||
}, |
||||
{ |
||||
"displayName": "C#", |
||||
"name": "c_sharp", |
||||
"id": 2 |
||||
} |
||||
], |
||||
"projects": [ |
||||
{ |
||||
"displayName": "Pendulum", |
||||
"version": "1.0", |
||||
"info": "Watch 500 Double-Pendulums diverge into chaos.", |
||||
"languageId": 1, |
||||
"name": "pendulum", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Christmas Tree", |
||||
"version": "1.0", |
||||
"info": "With this little nice tool you can have fun decorating your own Christmas Trees.", |
||||
"languageId": 1, |
||||
"name": "christmas_tree", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Toornament Teams", |
||||
"version": "1.0", |
||||
"info": "Small tool for creating multi op.gg links for teams in Toornament.", |
||||
"languageId": 1, |
||||
"name": "toornament_teams", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Circuits", |
||||
"version": "1.0", |
||||
"info": "Be smart and capture every circuit.", |
||||
"languageId": 2, |
||||
"name": "circuits", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Cube Run", |
||||
"version": "1.0", |
||||
"info": "The game that everyone knows with a few little changes.", |
||||
"languageId": 2, |
||||
"name": "cube_run", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Overwatch Statistics", |
||||
"version": "1.5.1", |
||||
"info": "Site to track Overwatch Competitive progress, because Blizzard API does not include Overwatch.", |
||||
"languageId": 0, |
||||
"name": "overwatch_stats", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Pathfinder", |
||||
"version": "1.0", |
||||
"info": "A graphical demonstration of some pathfinder algorithms.", |
||||
"languageId": 0, |
||||
"name": "pathfinder", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Bed Side-Chooser", |
||||
"version": "1.0", |
||||
"info": "Small program written by Sel♥ to know on which side of the bed she should sleep.", |
||||
"languageId": 0, |
||||
"name": "bed_random", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Doppler Effect", |
||||
"version": "1.0", |
||||
"info": "Graphical demonstration of the Doppler effect.", |
||||
"languageId": 0, |
||||
"name": "doppler_effect", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Chainreact", |
||||
"version": "1.2.3", |
||||
"info": "Capture fields by being smart!", |
||||
"languageId": 0, |
||||
"name": "chainreact", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Global Draw Sheet", |
||||
"version": "1.2.13", |
||||
"info": "A draw sheet for everyone. Have fun :)", |
||||
"languageId": 0, |
||||
"name": "global_draw", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Pong Remastered Online", |
||||
"version": "1.0", |
||||
"info": "My new version of the game Pong, also playable against friends.", |
||||
"languageId": 1, |
||||
"name": "pong", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Valentine Present ♥", |
||||
"version": "1.0", |
||||
"info": "For Sel♥", |
||||
"languageId": 0, |
||||
"name": "valentine", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Lissajous Curve", |
||||
"version": "1.0", |
||||
"info": "Live rendering of a graph of a system of parametric equations.", |
||||
"languageId": 0, |
||||
"name": "lissajous_curve", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Memory", |
||||
"version": "1.0", |
||||
"info": "A memory game, also works online with your friends.", |
||||
"languageId": 0, |
||||
"name": "memory", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Rubiks Cube", |
||||
"version": "1.0", |
||||
"info": "The 3x3 Rubiks Cube in 3D (wasn't easy!!).", |
||||
"languageId": 0, |
||||
"name": "rubiks_cube", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Jump And Run", |
||||
"version": "1.0", |
||||
"info": "Birthday present for Sel♥.", |
||||
"languageId": 0, |
||||
"name": "jump_and_run", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Bricks v3.1", |
||||
"version": "1.0", |
||||
"info": "My own version of the classical \"Break Bricks\".", |
||||
"languageId": 0, |
||||
"name": "bricks", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Colorpicker", |
||||
"version": "1.0", |
||||
"info": "Tool for determining color codes in HSB, RGB and HEX.", |
||||
"languageId": 0, |
||||
"name": "colorpicker", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Fibonacci", |
||||
"version": "1.0", |
||||
"info": "Standing picture of the Fibonacci sequence. For a moving version created by a friend of mine view <a href=\"http://v.bertlwieser.eu/js/fibonacci/\" target=\"_blank\">here</a>.", |
||||
"languageId": 0, |
||||
"name": "fibonacci", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Maths", |
||||
"version": "1.0", |
||||
"info": "My try of copying GeoGebra.", |
||||
"languageId": 0, |
||||
"name": "maths", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "2D Openworld", |
||||
"version": "1.0", |
||||
"info": "My first 2D Openworld project. You can explore by moving your cursor to the frame borders.", |
||||
"languageId": 0, |
||||
"name": "openworld", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Physics", |
||||
"version": "1.0", |
||||
"info": "A small physical interface for creating objects with interacting physical properties.", |
||||
"languageId": 0, |
||||
"name": "physics", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Palms", |
||||
"version": "1.0", |
||||
"info": "Very small moving picture of palms upon Sel's request.", |
||||
"languageId": 0, |
||||
"name": "palms", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Calculator", |
||||
"version": "1.0", |
||||
"info": "Working, but no perfect mathematical calculator.", |
||||
"languageId": 0, |
||||
"name": "calculator", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Sierpinski", |
||||
"version": "1.0", |
||||
"info": "Some sequences by the mathematician Sierpinski.", |
||||
"languageId": 0, |
||||
"name": "sierpinski", |
||||
"visible": true |
||||
}, |
||||
{ |
||||
"displayName": "Exior Web", |
||||
"version": "1.0", |
||||
"info": "A small website for an imaginary company, led by me and my class mates.", |
||||
"languageId": 0, |
||||
"name": "exior_web", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Cross Product", |
||||
"version": "1.0", |
||||
"info": "A 3D coordinates system which supported my presentation about the cross product in math class. Switch through states with arrow keys.", |
||||
"languageId": 0, |
||||
"name": "cross_product", |
||||
"visible": false |
||||
}, |
||||
{ |
||||
"displayName": "Circles", |
||||
"version": "1.0", |
||||
"info": "Inspired by the CodingTrain (senseless).", |
||||
"languageId": 0, |
||||
"name": "circles", |
||||
"visible": false |
||||
} |
||||
] |
||||
} |
@ -0,0 +1 @@ |
||||
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){var t=e.ajax.bind(e);e.ajax=function(n,r){"object"==typeof n&&(r=n,n=void 0);var o=(r=r||{chunking:!1}).xhr?r.xhr():e.ajaxSettings.xhr(),s=r.chunking||e.ajaxSettings.chunking;return r.xhr=function(){if("function"==typeof r.uploadProgress){if(!o.upload)return;o.upload.onprogress=null,o.upload.addEventListener("progress",function(e){r.uploadProgress.call(this,e)},!1)}if("function"==typeof r.progress){var e=0;o.addEventListener("progress",function(t){var n=[t],o="";this.readyState===XMLHttpRequest.LOADING&&s&&(o=this.responseText.substr(e),e=this.responseText.length,n.push(o)),r.progress.apply(this,n)},!1)}return o},t(n,r)}}); |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +0,0 @@ |
||||
<?php |
||||
|
||||
foreach (parse_ini_file($_SERVER['DOCUMENT_ROOT']."/../.env") as $key => $value) |
||||
putenv("$key=$value"); |
@ -0,0 +1,3 @@ |
||||
<?php |
||||
$port = parse_ini_file('../../env_config.ini')['nodejs_port']; |
||||
echo $port; |
@ -1,43 +0,0 @@ |
||||
<?php |
||||
|
||||
require_once "dotenv.php"; |
||||
|
||||
class MySQLConnection { |
||||
|
||||
private int $port; |
||||
private string $host; |
||||
private string $user; |
||||
private string $pass; |
||||
private string $dbName = "website"; |
||||
private mysqli $mysqli; |
||||
|
||||
public function __construct() { |
||||
$this->host = 'localhost'; |
||||
$this->port = intval(getenv('MYSQL_PORT')); |
||||
$this->user = getenv('MYSQL_USER'); |
||||
$this->pass = getenv('MYSQL_PASSWORD'); |
||||
$this->createConn(); |
||||
} |
||||
|
||||
private function createConn(): void { |
||||
$this->mysqli = new mysqli($this->host . ":" . $this->port, $this->user, $this->pass, $this->dbName); |
||||
} |
||||
|
||||
public function query($sql): mysqli_result|bool { |
||||
return $this->mysqli->query($sql); |
||||
} |
||||
|
||||
public function changeDB($dbName): void { |
||||
$this->dbName = $dbName; |
||||
$this->mysqli->select_db($dbName); |
||||
} |
||||
|
||||
public function escape(string $string): string{ |
||||
return $this->mysqli->real_escape_string($string); |
||||
} |
||||
|
||||
public function __destruct() { |
||||
$this->mysqli->close(); |
||||
} |
||||
|
||||
} |
Loading…
Reference in new issue