Skip to content

Instantly share code, notes, and snippets.

View OndrejSlamecka's full-sized avatar

Ondřej Slámečka OndrejSlamecka

View GitHub Profile
@OndrejSlamecka
OndrejSlamecka / demo.html
Last active April 1, 2016 14:40
jQuery plugin for turning select boxes to look-alike lists
<!--
Sets the value back to select
Understands selected attribute
Arrow control works
TODO: optgroup, size,… (I haven't had need for those yet – if you had and want to share please contact me)
-->
<select class="selectlike">
<option data-html="<b>Fancy text with HTML and styles</b>">Not so fancy fallback text</option>
</select>
@OndrejSlamecka
OndrejSlamecka / gist:2287537
Created April 2, 2012 22:03
Google Maps v3 API useGeolocation
/* Ondrej Slamecka 2012 */
/**
* @param success Callback called on success
* @returns bool
*/
google.maps.Map.prototype.useGeolocation = function(success, failure)
{
if(typeof success === 'undefined')
return false;
@OndrejSlamecka
OndrejSlamecka / gist:2256836
Created March 30, 2012 22:44
Get style property of DOM element using JavaScript
/**
* Returns styleProperty of given element
*/
function getStyle(el, styleProperty)
{
if (el.currentStyle)
return el.currentStyle[styleProperty];
else if (window.getComputedStyle)
return document.defaultView.getComputedStyle(el,null).getPropertyValue(styleProperty);
}
/* Ondrej Slamecka 2012
* <img id=loader><tr><a class='ajax highlight parent-tr'>Edit</a></tr>
* When you click the link, it will show the loader, on success it will hide the loader and animate <tr> (because of parent-tr)
* Color animation requires https://github.com/jquery/jquery-color
*/
function processSnippets(snippets)
{
if (snippets)
@OndrejSlamecka
OndrejSlamecka / TexyCache.php
Created January 3, 2012 18:37
Class for caching Texy! results
<?php
/**
* TexyCache - class for caching Texy! results
* -------------------------------------------
*
* Using Texy! the great web text markup-language processor by David Grudl (http://davidgrudl.com)
* For more information please visit http://texy.info
*
* @author Ondrej Slamecka, 2010
* @license New BSD license (see http://texy.info/en/licence)