Skip to content

Instantly share code, notes, and snippets.

@thomasthesecond
thomasthesecond / arrival-departure-datepicker.js
Last active December 14, 2015 16:49
jQuery datepicker with arrival/departure fields.
// Arrival Field
$('input.datepicker.arrival').datepicker(
{
dateFormat: 'mm/dd/yy',
minDate: 0
});
// Departure Field
$('input.datepicker.departure').datepicker(
{
@mixin breakpoint($breakpoint)
{
@if $breakpoint == tablet {
@media (max-width: $breakpoint-tablet) { @content; }
}
@else if $breakpoint == mobile {
@media (max-width: $breakpoint-mobile) { @content; }
}
}
@thomasthesecond
thomasthesecond / SASS-fixed-to-fluid.scss
Created May 27, 2013 16:55
Useful SASS functions to convert pixel values to percentages or ems.
@function ems($target, $context)
{
@return $target / $context * 1em
}
@function percent($target, $context)
{
@return $target / $context * 100%
}
@thomasthesecond
thomasthesecond / dotted-border.svg
Last active December 17, 2015 21:19
Create a dotted border with SVG.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@thomasthesecond
thomasthesecond / xcode-js-error-output.js
Last active December 19, 2015 20:48
Show JavaScript errors in Xcode. Put this script above all other scripts.
window.onerror = function(message, url, lineNumber) {
console.log('Error: ' + message + ' in ' + url + ' at line ' + lineNumber);
}
@thomasthesecond
thomasthesecond / ee-search-results.html
Created August 12, 2013 19:25
Text for ExpressionEngine search results page.
<p>
Your search for <strong>{exp:search:keywords}</strong>
returned <strong>{exp:search:total_results}{total_results}{/exp:search:total_results} result{if "{exp:search:total_results}" != 1}s{/if}</strong>.
</p>
@thomasthesecond
thomasthesecond / state-option-list.html
Created August 16, 2013 18:32
State option list.
<option value="">&ndash;</option>
<option value="AL">Alabama</option>
<option value="AK">Alaska</option>
<option value="AZ">Arizona</option>
<option value="AR">Arkansas</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DE">Delaware</option>
<option value="DC">District of Columbia</option>
@thomasthesecond
thomasthesecond / changeWindowLocationWithSelect.js
Created August 16, 2013 19:39
onchange event for select elements to change window.location. Good for EE category filtering.
self.changeWindowLocationWithSelect = function()
{
$('.' + classes.selectControllerClass).change(function()
{
if (this.value)
window.location.href = this.value;
else
return false;
});
};
@thomasthesecond
thomasthesecond / message.html
Created August 16, 2013 19:51
Message snippet for ExpressionEngine.
<div{if embed:id} id="{embed:id}"{/if} class="message message-{embed:type}{if embed:hidden == 'TRUE'} hidden{/if}">
{if embed:message}{embed:message}{/if}
</div><!-- .message -->
{!--
===================================
Required Parameters:
hidden: TRUE|FALSE
message: text string
type: alert|error|success
@thomasthesecond
thomasthesecond / db.php
Created September 23, 2014 13:54
Configuration files for Craft CMS
<?php
/**
* Database Configuration
*
* All of your system's database configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php
*/
return array(