Skip to content

Instantly share code, notes, and snippets.

View jacine's full-sized avatar
😁

Jacine Luisi jacine

😁
View GitHub Profile
@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 / .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 / 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 / .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 / 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 / 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 / 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 / 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 / template.php
Created August 17, 2011 19:15
Using hook_html_head_alter() to add or modify <head> contents.
<?php
/**
* Implements hook_html_head_alter().
*
* The purpose of this alter function is to modify the contents of the $head
* variable which prints in html.tpl.php. This variable is created in
* template_process_html() using the function drupal_get_html_head(). Here we
* add 2 <meta> tags, 1 <link> tag and simplify the <meta charset />.
*/
@jacine
jacine / gist:1128951
Created August 6, 2011 02:47
kextstat
jacineimac:~ jacine$ kextstat
Index Refs Address Size Wired Name (Version) <Linked Against>
1 82 0xffffff7f80731000 0x683c 0x683c com.apple.kpi.bsd (11.0.0)
2 6 0xffffff7f80745000 0x3d0 0x3d0 com.apple.kpi.dsep (11.0.0)
3 108 0xffffff7f8074f000 0x1b9d8 0x1b9d8 com.apple.kpi.iokit (11.0.0)
4 113 0xffffff7f80738000 0x9b54 0x9b54 com.apple.kpi.libkern (11.0.0)
5 95 0xffffff7f80746000 0x88c 0x88c com.apple.kpi.mach (11.0.0)
6 34 0xffffff7f80747000 0x4938 0x4938 com.apple.kpi.private (11.0.0)
7 50 0xffffff7f8072e000 0x22a0 0x22a0 com.apple.kpi.unsupported (11.0.0)
8 16 0xffffff7f80b9f000 0x7000 0x7000 com.apple.iokit.IOACPIFamily (1.4) <7 6 4 3>