Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jonraasch
jonraasch / jQuery.support-transition.js
Created April 21, 2010 14:32
Extends the jQuery.support object to CSS3 transition
// jQuery.support.transition
// to verify that CSS3 transition is supported (or any of its browser-specific implementations)
$.support.transition = (function(){
var thisBody = document.body || document.documentElement,
thisStyle = thisBody.style,
support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined;
return support;
})();
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@aza
aza / CSS Animation for jQuery.js
Created June 11, 2010 21:08
jQuery CSS Animation Extension
/* Copyright (c) 2011 Aza Raskin
|
| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
| documentation files (the "Software"), to deal in the Software without restriction, including
| without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
| copies of the Software, and to permit persons to whom the Software is furnished to do so, subject
| to the following conditions:
|
| The above copyright notice and this permission notice shall be included in all copies or substantial portions
| of the Software.
@jackfuchs
jackfuchs / jquery.support.cssproperty.js
Last active January 13, 2024 16:07
Extends the jQuery.support object to CSS Properties
/**
* jQuery.support.cssProperty
* To verify that a CSS property is supported
* (or any of its browser-specific implementations)
*
* @param p css property name
* @param rp optional, if set to true, the css property name will be returned
* instead of a boolean support indicator
* @return {mixed}
*
@rthrash
rthrash / Excerpt.php
Created October 6, 2010 23:26
A MODx filter for creating smart excerpts of long text passages
/**
* Excerpt
*
* Creates intro excerpts from long passages of text like a Ninja.
*
* @category snippet
* @version 1.0
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License (GPL)
* @autohor Kevin Marvin, Ryan Thrash
* @internal @modx_category Content
@rtripault
rtripault / getMany
Created November 16, 2010 17:18
The following code allows the retrieval of child document for the page the user is on. (source: http://www.unchi.co.uk/2010/11/16/modx-revolution-getmany-children/)
$criteria = $modx->newQuery('modResource');
$criteria->where(array(
'parent' => $modx->resource->get('id'),
'published' => 1,
'deleted' => 0,
));
$criteria->sortby('pagetitle','ASC');
$children = $modx->resource->getMany('Children',$criteria);
foreach($children as $var => $value)
{
@rtripault
rtripault / Input Option Values :
Created November 25, 2010 09:51
MODx Revolution snippet to list resources of a given parent in order to output it in Option Values of a TV
@EVAL return $modx->runSnippet('getAside');
@opengeek
opengeek / recalculateURIs.php
Created April 13, 2011 14:47
Script to recalculate all unfrozen URI values for MODX Resources in 2.1.x+
<?php
include 'config.core.php';
include MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx = new modX();
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
@jsmecham
jsmecham / Date.js
Created April 14, 2011 01:32
JavaScript Date Formatter
/**
* Date#strftime(format) -> String
*
* - format (String): the format string
*
* Formats the *date* according to the directives given in the *format*
* string. Requires a String#interpolate() extension.
*
* ## Format Components
*
@splittingred
splittingred / gist:1129536
Created August 6, 2011 17:20
merging arrays to send to modx->getChunk
<?php
$properties = array_merge($customObj->toArray(),$profile->toArray(),$user->toArray());
$output = $modx->getChunk('MyChunk',$properties);