Skip to content

Instantly share code, notes, and snippets.

@laurendavissmith
laurendavissmith / gist:1049294
Created June 27, 2011 17:10
ANT conditional
<target name="-conditional">
<input message="Would you like to do something now?" addproperty="RESPONSE" validargs="y,n" />
<condition property="-cont">
<equals arg1="${RESPONSE}" arg2="y" />
</condition>
</target>
<target name="-sure" if="-cont">
<echo>You did something!</echo>
</target>
@laurendavissmith
laurendavissmith / gist:1049326
Created June 27, 2011 17:27
ANT YUI compression
<target name="-compress">
<property name="YUI_COMPRESSOR" value="${RESOURCE_DIR}/yuicompressor-2.4.6.jar" />
<apply executable="java" parallel="false">
<fileset dir="${BUILD_DIR}" includes="${FILENAME}" />
<arg line="-jar"/>
<arg path="${YUI_COMPRESSOR}"/>
<srcfile/>
<arg line="-o"/>
<mapper type="glob" from="*.js" to="${BUILD_DIR}/*.compress.js"/>
@laurendavissmith
laurendavissmith / gist:1049332
Created June 27, 2011 17:30
ANT run jshint
<target name="-sanitize">
<apply executable="java" parallel="false" failonerror="true">
<fileset dir="${SRC_DIR}" casesensitive="yes">
<include name="**/*.js"/>
</fileset>
<arg line="-jar"/>
<arg path="${RESOURCE_DIR}/rhino.jar"/>
<arg path="${RESOURCE_DIR}/jshint-rhino.jar"/>
</apply>
</target>
YUI({
base : '[...]/yui/demos/loader-config-groups/library/',
combine : true,
comboBase : '[...]/combo/?b=yui/demos/loader-config-groups&f=',
root : 'library/',
filter : {
'searchExp': '(^(?:[^&]+&[^&]+)|[^&]+)&',
'replaceStr': '$1,'
},
groups : {
@laurendavissmith
laurendavissmith / gist:1160714
Created August 21, 2011 15:04
YUI Groups Partial
YUI({
base : '[...]/yui/demos/loader-config-groups/library/',
combine : true,
comboBase : '[...]/combo/?b=yui/demos/loader-config-groups&f=',
root : 'library/',
groups : {
gallery : {
base : '[...]/yui/demos/loader-config-groups/gallery/',
root : 'gallery/',
combine : true,
@laurendavissmith
laurendavissmith / pulse_exif_data
Last active December 14, 2015 07:19
adding exif data to a pulse slideshow
<koken:pulse jsvar="pulse" fallbacktext="No featured photos found. Please assign them in the Library." />
<div id="exif-text"></div>
<script>
pulse.on( 'transitionstart', function(e) {
var exif_fields = ['make','model','aperture'], // Insert the exif fields you would like shown eg. 'make','model','aperture'
exif_element = $('#exif-text'), // Change to the selector of where to insert the exif data
wrap = $('<span/>'); // Change to whatever tag the exif field should be wrapped with
@laurendavissmith
laurendavissmith / album.lens
Created March 28, 2013 14:16
clicking images inside albums to launch lightbox for the Boulevard theme
<koken:if false="pjax">
<koken:include file="inc/head.html" />
</koken:not>
<koken:load infinite="true">
<koken:head>
<meta property="og:site_name" content="{{ site.title }}" />
<meta property="og:title" content="{{ album.title strip_html="true" }}" />
<meta property="og:description" content="{{ album.summary strip_html="true" }}" />
@laurendavissmith
laurendavissmith / pulse_overlay_example
Last active December 17, 2015 04:08
pulse overlay using e.dom
(function() {
var overlay = $('<div class="__overlay__" />').css({
padding: '10px',
opacity: '.5',
background: '#000',
color: '#fff',
textAlign: 'right',
position: 'absolute',
fontSize: '11px'
})
<style type="text/css">
.pulse_overlay { padding: 10px; opacity: .5; background: #000; color: #fff; text-align: right; position: absolute; font-size: 11px; }
.pulse-arrow { position: absolute; top: 50%; margin-top: -52px; z-index: 1000; font-size: 70px; color: #fff; cursor: pointer; opacity: .75; font-weight: bold; }
.pulse-left { left: 10px; }
.pulse-right { right: 10px; }
</style>
<script>
(function() {
var leftArr = $('<div class="pulse-left pulse-arrow" data-action="next" />').html('&lang;'),
@laurendavissmith
laurendavissmith / pulse_loadItem_thumbstrip
Last active December 17, 2015 06:58
pulse.loadItem thumbstrip
<div id="pulse_strip">
<!-- Ideally you will want to use a loop here to create the ID's so they are dynamic and not hardcoded -->
<a href="" data-id="1"><span>1</span></a>
<a href="" data-id="2"><span>2</span></a>
<a href="" data-id="3"><span>3</span></a>
</div>
<p>
<koken:pulse jsvar="pulse" autostart="false" fallbacktext="No featured content found. Please assign some in the Library." />
</p>