Skip to content

Instantly share code, notes, and snippets.

@Abban
Abban / select.html
Created July 1, 2013 13:52
HTML Select Boxes That Don't Suck. For blog post (http://abandon.ie/notebook/simple-html-select-that-doesnt-suck)
<div class="select">
<select name="select_element">
<optgroup label="Option Group 1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</optgroup>
<optgroup label="Option Group 2">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
@Abban
Abban / db.php
Last active April 26, 2017 14:03
Add web environments to Anchor CMS
<?php
switch (WEB_ENV)
{
case 'local':
case 'development':
case 'staging':
case 'preview':
return array(
@Abban
Abban / anchor.php
Last active December 18, 2015 17:28
Get Anchor CMS Working on PHP 5.3.0+
<?php
// In anchor/libraries/anchor.php change lines 50 -65 from:
public static function functions() {
if( ! is_admin()) {
$fi = new FilesystemIterator(APP . 'functions', FilesystemIterator::SKIP_DOTS);
foreach($fi as $file) {
if($file->isFile() and $file->isReadable() and '.' . $file->getExtension() == EXT) {
@Abban
Abban / archives.php
Created June 19, 2013 18:25
Current Get Archives
<?php
$(function(){
var date = <?php echo get_the_date('F Y'); ?>';
$('.widget a[title="'+date+'"]').addClass('current');
});
<?php if(function_exists('abandon_cart_button')) abandon_cart_button('<div id="cart_button">', '</div>'); ?>
@Abban
Abban / cookie.php
Last active January 4, 2019 21:48
WP Config for multiple environments. Code is for this blog post: http://abandon.ie/wordpress-configuration-for-multiple-environments/
@Abban
Abban / css.css
Created June 19, 2013 18:04
Backbone loading spinner. First go and create and install a spinner on the spin.js website.
#loading{
position:fixed;
z-index:999;
top:0;
left:0;
width:100%;
height: 100%;
background:rgba(0,0,0,0.3);
}
@Abban
Abban / facebook-url-parse.php
Created June 19, 2013 17:54
Code To parse FB url and Twitter username
<?
protected function valid_facebook_url($field){
if(!preg_match('/^(http\:\/\/|https\:\/\/)?(?:www\.)?facebook\.com\/(?:(?:\w\.)*#!\/)?(?:pages\/)?(?:[\w\-\.]*\/)*([\w\-\.]*)/', $field)){
return false;
}
return true;
}
@Abban
Abban / EE-login-redirect.php
Last active December 18, 2015 15:39
Simple EE cookie redirect
<?php
/**
* logged in
*
* Programatically check logged in so EE doesnt parse a load of stuff if not
* Redirect if a redirection cookie has been set
*
* Usage
*
@Abban
Abban / Responsable-Blurb.html
Created March 23, 2013 17:53
Blurb for Responsable Grid
<p>A clean responsive grid system with a typographic baseline powered by LESS/SCSS.</p>
<ul>
<li><strong>Clean Markup:</strong> All grid styles are applied in your CSS leaving your markup nice, clean and shiny.</li>
<li><strong>CSS Normalize:</strong> No CSS reset is used, instead elements are normalised for browser consistency.</li>
<li><strong>Responsive Images:</strong> Uses the power of jQuery Picture to add responsitivity to all your images.</li>
<li><strong>Nested Columns:</strong> Column widths can be customised allowing for easy grid nesting and customisation.</li>
<li><strong>Baseline Grid:</strong> A baseline grid is integrated into css normalize adding consistency to your typography.</li>
<li><strong>Base Styles:</strong> Base form, table and typography styles are provided allowing a good jumping off point for your projects.</li>
</ul>