Skip to content

Instantly share code, notes, and snippets.

@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>
@Abban
Abban / button.css
Last active October 14, 2016 08:11
CSS to add a white or black alpha hover state on any colour button. This allows a single hover state to be applied to buttons of multiple colours without having to manually set colours.
.orange{ background: #ff7a4d; }
.blue{ background: #7396ff; }
.button {
display: inline-block;
*display: inline;
color: #ffffff;
text-decoration: none;
padding: 6px 10px;
position: relative;
@Abban
Abban / pan-to-seconds.m
Created March 4, 2013 18:01
Gesture callback to convert a pan into seconds.
- (void)secondPan:(UIPanGestureRecognizer *)gesture
{
if ((gesture.state == UIGestureRecognizerStateChanged) ||
(gesture.state == UIGestureRecognizerStateEnded)){
CGPoint location = [gesture locationInView:gesture.view.superview];
int topBound = gesture.view.bounds.size.height / 2.0f;
float bottomBound = gesture.view.superview.bounds.size.height - topBound;