Skip to content

Instantly share code, notes, and snippets.

View bazo's full-sized avatar

Martin Bazik bazo

View GitHub Profile
ab.connect("ws://localhost:8080",
// WAMP session was established
function(connection) {
// things to do once the session has been established
window.connection = connection;
connection.subscribe('deploy', function(topic, data) {
// This is where you would add the new article to the DOM (beyond the scope of this tutorial)
console.log(data); //this prints out broadcasted data
});
@bazo
bazo / gist:5427161
Last active December 16, 2015 11:28 — forked from anonymous/gist:5427135
<?php
//sid.php (indexy)
if(isset($SID["_MSG_ARRAY"])) foreach ( $SID["_MSG_ARRAY"] as $m ) $SID["MESSAGES"] .= $m;
if(isset($SID["_ERR_ARRAY"])) foreach ( $SID["_ERR_ARRAY"] as $m ) $SID["ERRORS"] .= $m;
if(isset($SID["_CON_ARRAY"])) foreach ( $SID["_CON_ARRAY"] as $m ) $SID["CONTENT"] .= $m;
//sid.php (variable)
//z kerej riti sa vzal $select_flag?
@bazo
bazo / config.neon
Created April 8, 2013 11:01
factory error
embeddedMedia:
class: Components\EmbeddedMedia
implement: Components\IEmbeddedMediaFactory
arguments: [%snippet%]
@bazo
bazo / gist:5233194
Last active December 15, 2015 08:48
json to array conversion
GsonBuilder gsonBuilder = new GsonBuilder();
Gson inputGson = new Gson();
ArrayList<ArrayList<String>> list = inputGson.fromJson(json, ArrayList.class);
Coordinate[] coordinates = new Coordinate[list.size()];
for (int i = 0; i < list.size(); i++) {
coordinates[i] = new Coordinate(Double.parseDouble(list.get(i).get(0)), Double.parseDouble(list.get(i).get(1)));
}
{
"location": {
"type": "Polygon",
"coordinates": [
[
48.122033990283,
17.036580815472
],
[
48.211966009717,
@bazo
bazo / ape.js
Created February 16, 2012 16:34
ape client
var apeConfig = {
domain: 'auto',
server: 'server.com:6969',
transport: 1,
}
var baseUrl = 'http://' + window.location.hostname;
if(window.location.port != 80)
{