Skip to content

Instantly share code, notes, and snippets.

View onexdrk's full-sized avatar

Artem Marinov onexdrk

View GitHub Profile
@onexdrk
onexdrk / index.html
Created October 7, 2012 16:09 — forked from kmtr/index.html
HTML: Twitter Bootstrap Template
<!doctype html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link rel="shortcut icon" href="ico/favicon.ico">
</head>
@onexdrk
onexdrk / gist:3871539
Created October 11, 2012 10:36
JQuery: boilerplate method wrapper
(function ($){
//some code here
})(jQuery);
@onexdrk
onexdrk / gist:3871546
Created October 11, 2012 10:38
JQuery: boilerplate method wrapper + document ready
(function ($){
$(function(){
//some code here
});
})(jQuery);
@onexdrk
onexdrk / gist:3930272
Created October 22, 2012 08:14
JSP: New JSP template
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
@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>
@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);
/*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 / 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;
}
@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 / 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) )