Skip to content

Instantly share code, notes, and snippets.

View zaigham's full-sized avatar
🌏

Zaigham R. zaigham

🌏
View GitHub Profile
<!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" />
.slideshow {
@include outerRow();
@include mobileRow();
@extend .white-box;
.slide {
@include column(12);
@include mobileColumn(4);
height: 400px;
padding: 8px;
var $container = $('#container');
$container.imagesLoaded(function(){
$container.masonry({
itemSelector : '.item',
columnWidth : 240
});
});
jQuery(document).ready(function ($) {
var $tagcloudArticles = $('#tagcloudArticles');
$tagcloudArticles.imagesLoaded(function(){
$tagcloudArticles.masonry({
// options
itemSelector : '.brick',
columnWidth : 230
});
@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);
@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 / modx-themes-tpl.html
Last active October 5, 2016 19:47
MODX Themes details from ThemeForest JSON API
<article class="col-sm-6 col-md-6 col-lg-6">
<div><a href="[[+url]]?ref=[[+ref]]"><img class="img-responsive" src="[[+live_preview_url]]" alt="[[+item]]"></a></div>
<div style="min-height: 6em;"><h4><a href="[[+url]]?ref=[[+ref]]">[[+item]]<br/><small>USD$[[+cost]]</small></h4></a></div>
</article>
protected void Page_PreRender(object sender, EventArgs e)
{
int temp = Convert.ToInt32(leftnav.Count);
if (count == 0 && Convert.ToInt32(leftnav.Count) == 0)
{
contentright.Attributes["class"] = "center-part";
}
else if (count == 0 && Convert.ToInt32(leftnav.Count) != 0)
@zaigham
zaigham / gist:c639c61b8b60c16f37fe
Created October 17, 2014 17:53
modDevTools download error log
[2014-10-17 22:42:56] (ERROR @ C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php : 232) PHP warning: array_merge(): Argument #1 is not an array
[2014-10-17 22:42:56] (ERROR @ C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php : 357) Recoverable error: Argument 2 passed to modTransportProvider::arg() must be of the type array, null given, called in C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php on line 232 and defined
[2014-10-17 22:42:56] (ERROR @ C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php : 365) Recoverable error: Argument 1 passed to modTransportProvider::args() must be of the type array, null given, called in C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php on line 359 and defined
[2014-10-17 22:42:56] (ERROR @ C:\Ampps\...\core\model\modx\transport\modtransportprovider.class.php : 379) PHP warning: array_merge(): Argument #2 is not an array
[2014-10-17 22:42:56] (ERROR @ C:\Ampps\...\core\model\mo
<?php
/**
* SessionManager
* A script that can be used for easy control over your session variables.
* Put this script in your core/components/ folder, inside a sessionman/ subdirectory.
*
* Load this one in your snippets/plugins like;
*
* $sessman = $modx->getService('session','SessionManager', $modx->getOption('sessman.core_path',null,$modx->getOption('core_path').'components/sessionman/'), $scriptProperties);
* if(!($sessman instanceof SessionManager)) { $modx->log(modX::LOG_LEVEL_ERROR, 'Session manager could not be loaded..'); return ''; }