A (somewhat) functional black-and-white TV from the early 20th century.
https://odan.github.io/2019/11/05/slim4-tutorial.html
If you liked the tutorial, please click here on the star button: https://github.com/odan/slim4-tutorial
For technical questions create an issue here: https://github.com/odan/slim4-tutorial/issues
If you have Slim framework specific questions use: https://discourse.slimframework.com/
This file contains hidden or 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 mysql = require('mysql'); | |
const MySQLEvents = require('@rodrigogs/mysql-events'); | |
const ora = require('ora'); // cool spinner | |
const spinner = ora({ | |
text: '🛸 Waiting for database events... 🛸', | |
color: 'blue', | |
spinner: 'dots2' | |
}); | |
const program = async () => { |
This file contains hidden or 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
// TodoPage.js | |
export const TodoContext = createContext({}); | |
class TodoPage extends React.Component { | |
state = { | |
todos: [ | |
{ id: 1, desc: 'Check email', completed: false }, | |
{ id: 2, desc: 'Write blog post', completed: false }, | |
], | |
user: { name: 'John', canDelete: true }, |
This file contains hidden or 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 | |
$address = '0.0.0.0'; | |
$port = 12345; | |
// Create WebSocket. | |
$server = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); | |
socket_set_option($server, SOL_SOCKET, SO_REUSEADDR, 1); | |
socket_bind($server, $address, $port); | |
socket_listen($server); |
This file contains hidden or 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
<html> | |
<body> | |
<div id="root"></div> | |
<script> | |
var host = 'ws://0.0.0.0:12345/websockets.php'; | |
var socket = new WebSocket(host); | |
socket.onmessage = function(e) { | |
document.getElementById('root').innerHTML = e.data; | |
}; | |
</script> |
This file contains hidden or 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
var xmlDoc = document.implementation.createDocument(null, "devices"); | |
var elements = xmlDoc.getElementsByTagName("devices"); | |
var node = xmlDoc.createElement("DeviceA"); // do not use the methods provided by the document namespace | |
node.setAttribute('ID', 1000); | |
node.setAttribute('DESCRIPTION', 'NameA'); | |
elements[0].appendChild(node); // add the element | |
var node = xmlDoc.createElement("DeviceB"); | |
node.setAttribute('ID', 2000); |
- add app.json, set the newest sdkVersion
{
"name": "<yourname>",
"displayName": "<yourname>",
"expo": {
"sdkVersion": "25.0.0"
}
}
This file contains hidden or 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 | |
/** | |
* Created by PhpStorm. * User: Faizan Khan * Date: 1/2/2018 * Time: 10:51 AM | |
*/ | |
/*Script Motive: The purpose of the file is to present different PDO Functions for DML and DDL operations | |
Sample Table | |
Table Name: UserTbl | |
Columns: Id, UserName, Email, RecordAddDate | |
*/ |
NewerOlder