Skip to content

Instantly share code, notes, and snippets.

View jacine's full-sized avatar
😁

Jacine Luisi jacine

😁
View GitHub Profile
@jacine
jacine / template.php
Created August 23, 2011 01:34
Add ARIA roles to blocks
<?php
/**
* Implements template_preprocess_block().
*/
function THEME_preprocess_block(&$vars) {
$roles = array(
'complementary' => array(
'aggregator',
'help',
@jacine
jacine / field.tpl.php
Created August 31, 2011 18:33
My default hook_preprocess_field() and field.tpl.php
<?php
/**
* Implements template_preprocess_field().
*/
function THEME_preprocess_field(&$vars) {
// If the view mode is "full" use <h2> for the field labels. Otherwise,
// assume a teaser or more compact view mode is being displayed, and use <h3>.
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3';
@jacine
jacine / tpl.html
Created September 3, 2011 00:12
hrm...
<span property="dc:date dc:created" content="2011-08-30T17:01:12-04:00" datatype="xsd:dateTime">
<time datetime="2011-08-30T21:01:12" pubdate="pubdate">30 Aug 2011</time>
</span>
@jacine
jacine / issues.php
Created October 16, 2011 13:18
Issues
<?php
// I can put the pages in manually. No biggie there.
$pages = array(
'http://drupal.org/project/issues/search/drupal?version[0]=8.x&issue_tags=html5',
'http://drupal.org/project/issues/search/drupal?page=1&version[0]=8.x&issue_tags=html5',
'http://drupal.org/project/issues/search/drupal?page=2&version[0]=8.x&issue_tags=html5',
);
?>
@jacine
jacine / .bash_profile
Created November 1, 2011 17:54
Command history
# Set history options
export HISTFILESIZE=10000000
export HISTSIZE=1000
export HISTCONTROL=ignoredups
# Write to history file whenever the prompt is displayed
PROMPT_COMMAND='history -a'
# Bind history-search-backward and forward to up and down arrow keys
bind '"\e[A"':history-search-backward
@jacine
jacine / template.php
Created November 19, 2011 01:02
Bye, bye region.tpl.php and block--system--main.tpl.php
<?php
/**
* Implements hook_page_alter().
*/
function mytheme_page_alter(&$page) {
// Remove all the region wrappers.
foreach (element_children($page) as $key => $region) {
if (!empty($page[$region]['#theme_wrappers'])) {
$page[$region]['#theme_wrappers'] = array_diff($page[$region]['#theme_wrappers'], array('region'));
@jacine
jacine / .htaccess
Created December 1, 2011 23:10
My favorite Drupal trick for local theme development
# Find this line and insert the code below it (adapted to use your sitename/server).
# RewriteBase /
# Use files on the dev server instead of syncing them locally.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sites/sitename/(files/.*)$ http://dev.whatever.com/sites/sitename/$1 [L,QSA]
@jacine
jacine / dot_tm_properties
Created December 14, 2011 21:53
TextMate 2 .tm_properties
# TextMate 2 defaults stored in TextMate.app/Contexts/Resources/Default.tmProperties
exclude = "{*.{o,pyc},Icon\r,CVS,_darcs,_MTN,\{arch\},blib,*~.nib}"
include = "{.tm_properties,.htaccess}"
TM_HG = "/opt/local/bin/hg"
TM_GIT = "/opt/local/bin/git"
[ "/usr/include/{**/,}*" ]
tabSize = 8
@jacine
jacine / dabblet.css
Created December 16, 2011 06:24
Drupal - Primary and secondary tabs.
/**
* Drupal - Primary and secondary tabs.
*/
ul.tabs {
border-bottom: solid 1px #ddd;
display: block;
margin: 0 0 20px 0;
padding: 0;
}
@jacine
jacine / dabblet.css
Created December 29, 2011 00:57
Fun with CSS3 gradients, animation and 3d transforms.
/**
* Fun with CSS3 gradients, animation and 3d transforms.
* Animation started with an example from @treehouse.
*/
/* Keyframes
------------------------------------------------------------------------------*/
@keyframes spin {
0% { transform: rotateY(0); }
100% { transform: rotateY(-360deg); }