Skip to content

Instantly share code, notes, and snippets.

View gustinmi's full-sized avatar

Mitja Guštin gustinmi

View GitHub Profile
package com.ellypos.rmq;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Log mock. Provides same method signatures as android logger or at least minimal replacement
* @author mgustin
*
*/
@gustinmi
gustinmi / HttpClient.java
Last active August 21, 2019 08:55
Java Http client simple
package http;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.Proxy;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import moped.common.Utils;
var myStyle = function getStyle(className_) {
var styleSheets = window.document.styleSheets;
var styleSheetsLength = styleSheets.length;
for(var i = 0; i < styleSheetsLength; i++){
var classes = styleSheets[i].rules || styleSheets[i].cssRules;
if (!classes)
continue;
var classesLength = classes.length;
for (var x = 0; x < classesLength; x++) {
@gustinmi
gustinmi / gist:280ef29a18580eee7e4f
Created January 23, 2015 21:31
Javascript tab panel using pure javascript
<!DOCTYPE html>
<html>
<head>
<title>tabs demo</title>
<style type="text/css">
.tabs ul {
list-style-type: none;
margin: 0 2em;
padding: 0;
cursor: pointer;
@gustinmi
gustinmi / jstemplates2.html
Last active April 26, 2024 08:50
JavaScript Templating Full Edition (settings, localization, micro templates )
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>templator2</title>
<style type="text/css">
html, body {
font-size: 14px;
@gustinmi
gustinmi / jsmicrotmpl.js
Created November 23, 2014 18:59
JavaScript Templating Framework Easy 1
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>templator</title>
<style type="text/css">
#content {
padding: 5px;
@gustinmi
gustinmi / html5template.html
Created April 16, 2013 10:35
HTML5 View Template Features: responsive layout, header, footer, content. Footer is always at bottom. Content occupies all available and remaining viewport. Preview: https://googledrive.com/host/0B-KXuLdFNBwiWG5TYzBmUjRzeVk/html5template.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<title>HTML5Template</title>
<style type="text/css">
html, body { height: 100%; width: 100%; } /* occupy whole viewport. */
body,div,p {
/* css reset techique; We are resetting the UserAgent (browser) style */
@gustinmi
gustinmi / timeline.html
Created February 15, 2013 13:02
Creating simple mobile-style page navigation, where pages slide-in.
<!DOCTYPE html>
<html>
<head>
<title>Creating simple page navigator with remote pages</title>
<style type="text/css">
div.viewport {
position: relative;
border-collapse: collapse;
width: 800px;
height: 200px;
@gustinmi
gustinmi / gist:4952465
Last active December 13, 2015 17:59
jQuery Tables plugin. Below is the code that triggers the update ajax source via your own custom event handler, possibly passing http paramaters.
//This is the extension function for table plugin (My params are array of key value pairs). Make this script available to your //web page which is utilizing the table plugin
$.fn.dataTableExt.oApi.fnReloadAjax = function (oSettings, sNewSource, myParams ) {
if ( oSettings.oFeatures.bServerSide ) {
oSettings.aoServerParams = [];
oSettings.aoServerParams.push({"sName": "user",
"fn": function (aoData) {
for (var i=0;i<myParams.length;i++){
aoData.push( {"name" : myParams[i][0], "value" : myParams[i][1]});
@gustinmi
gustinmi / logger.js
Created February 13, 2013 16:41
Simple JavaScript logging framework.
/**
* Simple logging framwork
* Supports Chrome or Firefox
* Usage:
*
* AppHtml5.log.info('Dropdown value changed to something new!');
*
*/
//create logging functions