Skip to content

Instantly share code, notes, and snippets.

View martinsik's full-sized avatar

Martin Sikora martinsik

View GitHub Profile
@martinsik
martinsik / libwebsockets-webserver.c
Created July 31, 2012 11:34
Simple webserver based on libwebsockets library. Read full description at http://martinsikora.com/libwebsockets-simple-http-server
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <libwebsockets.h>
static int callback_http(struct libwebsocket_context *context,
struct libwebsocket *wsi,
enum libwebsocket_callback_reasons reason, void *user,
@martinsik
martinsik / webgl-demo.dart
Last active November 7, 2020 18:24
Dart + WebGL. For more information visit http://martinsikora.com/dart-webgl-simple-demo
import 'dart:html';
/**
* WebGL Demo made in Dart.
* Updated: March 11th 2013 - Dart SDK 0.4.1
* This example is heavily inspired by:
* http://www.netmagazine.com/tutorials/get-started-webgl-draw-square
*/
class WebGLTest {
@martinsik
martinsik / chat-frontend.js
Last active March 22, 2025 16:43
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@martinsik
martinsik / gist:1037877
Created June 21, 2011 13:46
Inheritance test
function MyClassA() {
console.log('constructor for MyClassA');
this.var1 = "hello";
this.var2 = 2;
this.method1 = function() {
console.log('calling method1 of MyClassA');
}
}