Skip to content

Instantly share code, notes, and snippets.

View iampava's full-sized avatar
💭
I code and teach JavaScript.

Alexandru Pavaloi iampava

💭
I code and teach JavaScript.
View GitHub Profile
@iampava
iampava / app.js
Last active June 9, 2020 07:16
Offscreen Canvas width limitation?
/**
At this canvas width, the normal one gets rendered but the offscreen one is still empty.
However, if you change this to a lower number both will work.
*/
const WIDTH = 20000;
const [firstCanvas, secondCanvas] = document.querySelectorAll('canvas');
firstCanvas.width = WIDTH;
secondCanvas.width = WIDTH;
@iampava
iampava / Root.jsx
Created January 21, 2019 19:31
#2 JavaScript: fast and furious
import {
LazyLanding,
LazyHome
} from './pages/Pages.lazy';
class Root extends React.Component {
render() {
return (
<Switch>
<Route exact path="/" component={LazyLanding} />
@iampava
iampava / Pages.lazy.jsx
Created January 21, 2019 19:31
#1 JavaScript: fast and furious
import Loadable from 'react-loadable';
// Landing page
const LazyLandingPage = Loadable({
loader: () => import('./landing/Landing.page'),
modules: ['./landing/Landing.page'],
webpack: () => [require.resolveWeak('./landing/Landing.page')]
});
const LazyLanding = props => <LazyLandingPage {...props} />;
@iampava
iampava / index.html
Created May 19, 2018 11:52
SOAP Web Service in PHP | Author: Teodor Proca
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>LAb10</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
@iampava
iampava / app.php
Created May 17, 2018 08:37
SOAP Web Service in PHP | Sergiu Iacob
<?php
define ('WS_URL', 'http://localhost:1234/lab12/ws.php');
try {
$client = new SoapClient(null, // nu furnizam niciun WSDL
array('location' => WS_URL, // adresa serviciului Web
'uri' => 'http://web.info/porto', // spatiul de nume corespunzator serviciului Web apelat
'trace' => 1 // se vor furniza informatii de depanare
)
);
@iampava
iampava / app.php
Created May 17, 2018 08:34
SOAP Web Service in PHP | Author: Lucian Bosinceanu
<?php
define ('WS_URL', 'http://localhost/weather/ws.php');
try {
$client = new SoapClient(null, // nu furnizam niciun WSDL
array('location' => WS_URL, // adresa serviciului Web
'uri' => 'http://web.info/porto', // spatiul de nume corespunzator serviciului Web apelat
'trace' => 1 // se vor furniza informatii de depanare
)
@iampava
iampava / app.php
Created May 17, 2018 08:31
SOAP Web Service in PHP | Author: Lucian Cochior
<?php
define ('WS_URL', 'http://localhost/weather.php');
try {
$client = new SoapClient(null,
array('location' => WS_URL,
'uri' => 'http://web.info/porto', //
'trace' => 1
)
@iampava
iampava / xml-serialization.php
Last active May 2, 2018 07:19
Creating an XML file from PHP using DOM | Author: Răzvan Sbîngu
<?php
$domtree = new DOMDocument('1.0', 'UTF-8');
$xmlRoot = $domtree -> createElement("books");
$book = $domtree -> createElement("book");
$book -> appendChild( $domtree -> createElement("title", "Harry Potter") );
$book -> appendChild( $domtree -> createElement("description", "Best book") );
$book -> setAttribute("class", "gallery");
@iampava
iampava / book-collection.xml
Last active May 1, 2018 07:12
Modelling a book collection in XML | Author: Angel Ardeleanu
<?xml version="1.0" encoding="UTF-8" ?>
<collection>
<books>
<book>
<title> bla bla bla </title>
<author_id> 13 </author_id>
<background> BG.com/blablabla.png </background>
<price>130</price>
<description> aceasta este o descriere </description>
<publication>
@iampava
iampava / index.php
Created March 28, 2018 13:37
Show message based on query params
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
<form class="form" id="loginForm" action="./login.php" method="POST">
<!-- -->
</form>
<?php