Skip to content

Instantly share code, notes, and snippets.

View JiLiZART's full-sized avatar
💭
I may be slow to respond.

Nikolay Kost JiLiZART

💭
I may be slow to respond.
View GitHub Profile

Using Pseudo Elements for Input Styling

On supported browsers, the pseudo elements can be used to style the inputs for checkbox/radio for their checked and unchecked states while still providing a functional fallback for browsers that don't support input styling without doing weird resets. Most notable issue is pseudo elements not existing for inputs on firefox. Check it out in Chrome & Safari.

A Pen by Alex Bergin on CodePen.

License.

###
# Retina images handler
###
if ($http_cookie ~* "isRetina=1" ) {
set $isRetina "retina";
}
location ~ ^/bundles/(.*)-retina\.png {
try_files /bundles/$1-retina.png @retinaFallback;
}
@JiLiZART
JiLiZART / EActiveRecordAsArrayBehavior.php
Last active December 17, 2015 17:59
Extends base yii CActiveRecord, for return results as array
<?php
/**
* Class EActiveRecordAsArrayBehavior
* @method CActiveRecord getOwner()
*/
class EActiveRecordAsArrayBehavior extends CActiveRecordBehavior
{
/**
@JiLiZART
JiLiZART / index.html
Created May 20, 2013 15:13
A CodePen by David HC.
<div class='button'>
<div class='iphone'><div class='knob'></div></div><center><span>Available on the <h2>App Store</h2></span></center>
</div>
<h1 class='price'>$9.00</h1>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'>
@JiLiZART
JiLiZART / jquery.filter.expr.md
Created May 13, 2013 18:51
jQuery Contains Expression, checks if element contain a value

Code

  jQuery.expr[':'].contains = function(a,i,m){
      return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase())>=0;
  };
  

Usage

@JiLiZART
JiLiZART / script query extract.md
Created May 8, 2013 10:52
Extracty query from included js script
<script src="js/somefile.js?option=1,option2,option3"></script>
query = document.getElementsByTagName("script");
query = query[query.length - 1].src;
if (- 1 == query.indexOf("?")) query += "?";
@JiLiZART
JiLiZART / jquery.smallTabs.js
Created April 29, 2013 13:45
Very light tabs div.tabs-container>(ul.tabs>li*3)+(div.tab*3)
/**
* @author Nikolay Kostyurin <[email protected]>
* Very lightweight tabs
*/
;(function ( $, window, document, undefined ) {
var pluginName = 'smallTabs',
defaults = {
content: 'div.tab',
navigation: 'ul.tabs',
@JiLiZART
JiLiZART / jquery.tmpl.js
Created April 26, 2013 03:55
doT.js jQuery wrapper function by Artem Sapegin
$.fn.tmpl = function(tmplId, data) {
var tmpl = doT.template($('#tmpl_' + tmplId).text());
if (!$.isArray(data)) data = [data];
return this.each(function() {
var html = '';
for (var itemIdx = 0; itemIdx < data.length; itemIdx++) {
html += tmpl(data[itemIdx]);
}
$(this).html(html);