Skip to content

Instantly share code, notes, and snippets.

View zaigham's full-sized avatar
🌏

Zaigham R. zaigham

🌏
View GitHub Profile
@zaigham
zaigham / equalheight-columns.js
Last active December 15, 2015 16:49
A quick solution for same height columns.
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script type="text/javascript">
var max = 0;
$(".col").each(function(){
if ($(this).height() > max) {
max = $(this).height();
}
});
@zaigham
zaigham / gist:4612852
Last active December 11, 2015 14:18
Hack to stop Chrome from downloading phpthumb images on every transition in slider
<?php
// AROUND LINE 3909 in phpthumb.class.php: added >>>> header('Cache-Control:'); <<<< to the logic.
if (function_exists('ImageTypes')) {
$imagetypes = ImageTypes();
if ($imagetypes & IMG_PNG) {
header('Content-Type: image/png');
header('Cache-Control:');
ImagePNG($gdimg_error);
jQuery(document).ready(function ($) {
var $tagcloudArticles = $('#tagcloudArticles');
$tagcloudArticles.imagesLoaded(function(){
$tagcloudArticles.masonry({
// options
itemSelector : '.brick',
columnWidth : 230
});
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : '.item',
columnWidth : 240
});
});
.slideshow {
@include outerRow();
@include mobileRow();
@extend .white-box;
.slide {
@include column(12);
@include mobileColumn(4);
height: 400px;
padding: 8px;
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
$total-columns : 24; // a 24-column grid
$column-width : 1.875em; // each column is 30px wide
$grid-padding : 0.313em; // 5px grid-padding
$gutter-width : $grid-padding*2; // 5*2px gutters between columns
$desktop : 24;
$tablet : 16 (($column-width*16)+($gutter-width*15))em;
$mobile : 8 (($column-width*8)+($gutter-width*7))em;
<?php
/*echo '<pre>';
print_r($_GET);
echo '</pre>';*/
if (empty($_GET['api'])) {
return 'Empty Request. No data saved.';
}
else {
$db_water_flow = filter_var($_GET[waterFlow], FILTER_SANITIZE_STRING);
@zaigham
zaigham / microdata.modx.html
Created November 30, 2011 12:22
microdata.modx.html
<link rel="canonical" href="[[~[[*id]]? &scheme=`full`]]" />
<meta property="og:image" content="[[++site_url]]pt/phpThumb.php?src=/[[*siteThumb]]&amp;w=90&amp;h=90&amp;q=80&amp;zc=T"/>
<meta property="og:site_name" content="[[++site_name:htmlent]]"/>
<meta property="og:title" content="[[*pagetitle]]"/>
<meta property="og:url" content="[[++site_url]][[~[[*id]]]]"/>
<meta property="og:type" content="article"/>
<meta itemprop="name" content="[[*pagetitle]]">
<meta itemprop="description" content="[[*siteDescription:word_limit=`70`]]">
<meta itemprop="image" content="[[++site_url]]pt/phpThumb.php?src=/[[*siteThumb]]&amp;w=90&amp;h=90&amp;q=80&amp;zc=T">
@zaigham
zaigham / gist:1377387
Created November 18, 2011 18:53
My Journey to Learn SIMPLX Widgeteer
<h2>Something should show up down there</h2>
[[!simplx_widgeteer?
&dataSetUrl=`http://modxclub.com/rss-feed`
&useChunkMatching=`true`
&preprocessor=`widgeteer_preprocessor_xml2json`
&chunkPrefix=`modx.feed.tpl_`
]]
<hr/>