Skip to content

Instantly share code, notes, and snippets.

Nils Deele

View GitHub Profile
@Deele
Deele / sse.html
Last active Mar 2, 2018
Server-Sent Events example, Javascript client-side, PHP server-side
View sse.html
<html>
<body>
<div id="result"></div>
<script>
if (typeof(EventSource) !== 'undefined') {
console.info('Starting connection...');
var source = new EventSource('/stream.php');
source.addEventListener('open', function(e) {
console.info('Connection was opened.');
}, false);
@Deele
Deele / baseHtml.js
Created Jan 7, 2015
Port of Yii2 BaseHtml class that provides a set of static methods for generating commonly used HTML tags
View baseHtml.js
/**
* Returns whether given variable is undefined
*
* @author Nils Lindentals <nils@dfworks.lv>
* @license GNU GPL v2.0
*
* @param variable
* @returns {boolean}
*/
function isUndefined(variable) {
You can’t perform that action at this time.