Skip to content

Instantly share code, notes, and snippets.

View anthonyringoet's full-sized avatar

Anthony R anthonyringoet

View GitHub Profile
@anthonyringoet
anthonyringoet / uri.js
Created April 20, 2012 13:33 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.host; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
@anthonyringoet
anthonyringoet / theme.info
Created April 22, 2012 13:50
drupal foad
; css - fuck off and die
stylesheets[all][] = twitter-pull-listing.css
@anthonyringoet
anthonyringoet / template.php
Created April 27, 2012 10:23
remove defined classes from classes_array
<?php
$toRemove = array('someClassname', 'anotherDirtyClass');
$vars['classes_array'] = array_values(array_diff($vars['classes_array'], $toRemove));
@anthonyringoet
anthonyringoet / gluecode.module
Created May 4, 2012 07:36
drupal addthis translatable title attributes
<?php
/**
* Implements hook_addthis_markup_alter.
*
* @param array $markup
* $markup contain an array with the structure of the addthis markup.
*/
function gluecode_addthis_markup_alter(&$markup) {
// alter markup to add title's that are translatable by Drupal
if (!empty($markup['twitter'])) {
@anthonyringoet
anthonyringoet / dabblet.css
Created May 4, 2012 12:40 — forked from LeaVerou/dabblet.css
Vertical centering with Flexbox + margin fallback
/**
* Vertical centering with Flexbox + margin fallback
* Lea Verou & David Storey
*/
html, body { height: 100%; }
body {
width: 100%; /* needed for FF */
margin: 0;
@anthonyringoet
anthonyringoet / page.tpl.php
Created May 9, 2012 07:30
mothership - no empty tabs markup
<?php if (isset($tabs['#primary'][0]) || isset($tabs['#secondary'][0])): ?>
<nav class="tabs"><?php print render($tabs); ?></nav>
<?php endif; ?>
@anthonyringoet
anthonyringoet / ds-field.php
Created May 10, 2012 09:15
Display Suite field to link one field over another
<?php
$url = $entity->field_name_link['und']['0']['url'];
$imgField = $entity->field_name_image['und']['0'];
$config = array(
'style_name' => 'i_am_the_name_of_your_image_style',
'path' => $imgField['uri'],
'title' => $imgField['alt'],
'alt' => $imgField['title'],
'width' => $imgField['width'],
'height' => $imgField['height']
@anthonyringoet
anthonyringoet / nav.scss
Created May 16, 2012 10:32
nav abstraction
.nav{
list-style:none;
li{
display:inline;
}
a{
@include inline-block;
}
}
@anthonyringoet
anthonyringoet / island.scss
Created May 16, 2012 10:34
island abstraction
.island{
padding:1em;
> :last-child{
margin-bottom:0;
}
}
@anthonyringoet
anthonyringoet / images.scss
Created May 22, 2012 08:04
prettify image floats that get inline styles with floats by wysiwyg editors
img{
margin:10px;
&[style*="float:left"]{
margin-left:0;
}
&[style*="float:right"]{
margin-right:0;
}
}