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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Web App 1</title> | |
<link rel="stylesheet" href="./style.css"> | |
</head> | |
<body> |
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 | |
require_once "./config/db.php"; | |
if ($_SERVER['REQUEST_METHOD'] === "POST") { | |
//Make sure that the content type of the POST request has been set to application/json | |
$contentType = isset($_SERVER["CONTENT_TYPE"]) ? trim($_SERVER["CONTENT_TYPE"]) : ''; | |
if (strcasecmp($contentType, 'application/json') != 0) { | |
// throw new Exception('Content type must be: application/json'); | |
exit('Content type must be: application/json'); |
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 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === 'some-long-SHA-checksum-number-goes-here') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
php composer-setup.php | |
php -r "unlink('composer-setup.php');" |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Document</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js" integrity="sha512-BNaRQnYJYiPSqHHDb58B0yaPfCu+Wgds8Gp/gU33kqBtgNS4tSPHuGibyoeqMV/TJlSKda6FXzoEyYGjTe+vXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.0/FileSaver.min.js" integrity="sha512-csNcFYJniKjJxRWRV1R7fvnXrycHP6qDR21mgz1ZP55xY5d+aHLfo9/FcGDQLfn2IfngbAHd8LdfsagcCqgTcQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> | |
<style> |
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
const test_array = [1, 2, 3]; | |
function get_combinations(arr) { | |
var permArr = [], | |
usedChars = []; | |
function permute(input) { | |
var i, ch; | |
for (i = 0; i < input.length; i++) { | |
ch = input.splice(i, 1)[0]; | |
usedChars.push(ch); |
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
/* | |
* @description An image to ascii text conversion library | |
*/ | |
class ImageToAscii { | |
constructor(image) { | |
this.image = image; | |
this.toText = this.toText.bind(this); | |
} |
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
sudo apt install libdvdnav4 libdvd-pkg gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libdvd-pkg | |
sudo apt install ubuntu-restricted-extras |
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
const { htmlToAST, toks } = require("./html-to-ast"); | |
const SELF_CLOSING_TAG = "SELF_CLOSING_TAG"; | |
const OPENING_TAG = "OPENING_TAG"; | |
const TEXT_ELEMENT = "TEXT_ELEMENT"; | |
function astToHTML(ast) { | |
const start = "<" + ast.TagName + ">"; | |
let mid = ""; | |
const end = "</" + ast.TagName + ">"; |
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
/** | |
* @description A simple function to parse markdown code into HTML | |
*/ | |
const parseMarkdown = (str) => str.replace(/^# (.*$)/gim, "<h1>$1</h1>") | |
.replace(/^## (.*$)/gim, "<h2>$1</h2>") | |
.replace(/^### (.*$)/gim, "<h3>$i</h3>") | |
.replace(/^#### (.*$)/gim, "<h4>$i</h4>") | |
.replace(/^##### (.*$)/gim, "<h5>$i</h5>") | |
.replace(/^###### (.*$)/gim, "<h6>$i</h6>") |
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
const bot = require("./training"); | |
console.log("Hello I'm Bujo. Let's Talk :)"); | |
bot.converse(); |