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
| <!DOCTYPE html > | |
| <head> | |
| <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
| <title>Using MySQL and PHP with Google Maps</title> | |
| <style> | |
| /* Always set the map height explicitly to define the size of the div | |
| * element that contains the map. */ | |
| #map { | |
| height: 100%; |
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
| app.get('/texts', function (req, res) { | |
| connection.query('SELECT * FROM texts', function (error, results, fields) { | |
| if (error) throw error; | |
| return res.send({error: false, data: results, message: 'Texts list'}) | |
| }) | |
| }); |
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 express = require('express'); | |
| var app = express (); | |
| app.get('/', function(req, res) { | |
| var number = 200; | |
| res.status(number).send("hello World"); | |
| }); | |
| app.listen(3000); |
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 http = require("http"); | |
| http.createServer(function (req, res) { | |
| res.writeHead(200, {"Content-Type" : "text/plain"}); | |
| res.write("witaj świecie"); | |
| res.end(); | |
| }).listen(3000); |
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
| function $(el) { | |
| return document.querySelector(el); | |
| } |
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
| document.addEventListener("DOMContentLoaded", function(){ | |
| // Handler when the DOM is fully loaded | |
| }); |
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
| <script> | |
| const e = React.createElement; | |
| ReactDOM.render( | |
| e('div', null, 'Hello World'), | |
| document.getElementById('app') | |
| ) | |
| </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 Component = createReactClass({ | |
| render: function () { | |
| return React.DOM.span(null, "i'm so awesome") | |
| } | |
| }); | |
| var ComponentFactory = React.createFactory(Component); | |
| ReactDOM.render( | |
| ComponentFactory(), |
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 Component = createReactClass({ | |
| render: function () { | |
| return React.DOM.span(null, "I'm so custom"); | |
| } | |
| }); | |
| ReactDOM.render( | |
| React.createElement(Component), | |
| document.getElementById("app") | |
| ) |
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
| <script type="text/babel"> | |
| var P = React.createElement("p", {"className": "name"}, "Hello There"); | |
| var root = document.getElementById("root"); | |
| ReactDOM.render(P, root, () => console.log("We have just render")); | |
| </script> |