Skip to content

Instantly share code, notes, and snippets.

View onexdrk's full-sized avatar

Artem Marinov onexdrk

View GitHub Profile
@onexdrk
onexdrk / gist:603013194e8b1ee5043a
Created November 23, 2014 23:47
install protobuf 2.3.0 on mac os (10.10 in my case)
To install protobuf 2.3.0 in mac os (10.10) you need to do folowing:
install mac os developer tools
download and extract protobuf 2.3.0 : https://code.google.com/p/protobuf/downloads/list
open src/google/protobuf/message.h
and change lines to (see https://code.google.com/p/protobuf/issues/detail?id=570 and http://alfredgamulo.com/problem-installing-protobuf-2-3-0-on-mac/ if you want)
#ifdef __DECCXX
// HP C++'s iosfwd doesn't work.
@onexdrk
onexdrk / gist:5af58b8a2bfa2e6fc849
Created October 17, 2014 13:52
DBVisualizer - monitor
select '${DbVis-Date}$ ${DbVis-Time}$' as PollTime, status_msg from table
@onexdrk
onexdrk / _.deepPick.js
Last active August 29, 2015 14:01
underscore.js mixin for pick nested properties
/**
* Require _.deep.js from https://gist.github.com/furf/3208381
*/
_.mixin({
deepPick: function (obj) {
var ArrayProto = Array.prototype;
var copy = {};
var keys = ArrayProto.concat.apply(ArrayProto, ArrayProto.slice.call(arguments, 1));
@onexdrk
onexdrk / gist:7245972
Created October 31, 2013 08:18
Send ZK onChange server event
/**
* Send ZK onChange server event
* @param zkid - zk component id
* @param value - text to set in value
* example client control:
* <textbox id="zkid" onChange="@command('methodName', param1=self.value)" visible="false"/>
*
* example server method:
* @Command
* public void methodName(@BindingParam("param1") String param1) {
@onexdrk
onexdrk / PGSQL bitmask select
Created September 5, 2013 11:37
PGSQL bitmask select
select * from aaa where ((rubrics::bit(40)::bit varying(40) & B'0000000000000000000000000000000011'::bit(40)::bit varying(40)) > B'0'::bit(40)::bit varying(40) )
@onexdrk
onexdrk / isIE6.js
Created April 5, 2013 09:04
IE6 checker function. return true if IE6
function isHellIE() {
return typeof document.body.style.maxHeight == "undefined";
}
@onexdrk
onexdrk / createSwfObject.js
Created April 5, 2013 08:01
cross browser swf object create Example: var swf = createSwfObject('http://swf.url', {id: 'swfid', width: 250, height: 250}, {wmode: 'transparent'}); document.body.appendChild(swf);
function createSwfObject(src, attributes, parameters) {
var i, html, div, obj, attr = attributes || {}, param = parameters || {};
attr.type = 'application/x-shockwave-flash';
if (window.ActiveXObject) {
attr.classid = 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000';
param.movie = src;
}
else {
attr.data = src;
}
/*Make position:fixed work in IE6!*/
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;}
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;}
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;}
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;}
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;}
* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));}
* html .fixed-right /* IE6 position fixed right */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));}
@onexdrk
onexdrk / gist:3972853
Created October 29, 2012 10:32
JS: Time to action
var start = new Date().getTime();
//action
var elapsed = new Date().getTime() - start;
alert("time to action: "+elapsed);
@onexdrk
onexdrk / gist:3930280
Created October 22, 2012 08:16
JSP: Tiles - Insert template
<tiles:insertTemplate template="/WEB-INF/filename.jsp">
<tiles:putAttribute name="var" value="value" cascade="true"/>
</tiles:insertTemplate>