This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch($n_node->type) { | |
case 'your-custom-content-type-machine-name-here': | |
$html = l('"'.$n_node->title .'"', 'node/'.$n_node->nid, array('html' => TRUE, 'attributes' => array('class' => array('prev-next'), 'title' => $n_node->title))); | |
return $html; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def explain! | |
puts 'Want to embed this Gist?' | |
puts 'Use this: <script src="http://gist.github.com/2059.js"></script>' | |
end | |
explain! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2 class="entry-title"> | |
<a href="web.html"> | |
The title of an awesome post | |
<span class="glyph" href="web.html">»</span> | |
</a> | |
</h2> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hide-text { | |
text-indent: 100%; | |
white-space: nowrap; | |
overflow: hidden; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('tbody > tr').each(function(){ | |
if ($(this).hasClass('header')) { | |
counter=1; | |
} else { | |
if (counter == 1) { | |
$(this).addClass('even'); | |
counter++; | |
} else if (counter == 2) { | |
$(this).addClass('odd'); | |
counter--; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul { | |
display: block; | |
width: 100%; | |
text-align: center; | |
} | |
li { | |
position: relative; | |
display: inline; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pj_preprocess_node(&$variables) { | |
//change ['pjtest'] to name of the variable you're creating | |
$variables['pjtest'] = 'PJ is Testing'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.getMyHTMLTag')[0].tagName; | |
//returns 'P' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default). | |
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic. | |
# Required variables: | |
RSS_URI="/rss" | |
MAIL_TO="[email protected]" | |
LOG_FILE="/var/log/httpd/access_log" |