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
/** | |
* Trimtext | |
* This function will trim text without cutting it in | |
* the middle of the word and adding … if longer | |
*/ | |
public function trimText($text, $length) { | |
$words = explode(" ", $text); | |
$text = ""; | |
foreach ($words as $word) { | |
if (strlen($text." ".$word) <= $length) { |
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
<?php | |
$array = (1,2,3); | |
$last = array_pop($array); | |
echo strtolower(implode(', ', $array)." and ".$last); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Test</title> | |
<!-- Bootstrap --> | |
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> |
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
/* | |
Returns a MySQL date as: '2 days ago', 'right now', '14 hours ago'... | |
If date is older than 7 days then it displays it as 'September 1' | |
// Example | |
console.log( nice_time('2014-09-01 13:12:01') ); | |
// Spanish config | |
var options = { |
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
<?php | |
/** | |
* returns positive if male, negative if female | |
*/ | |
function gender( $s ) | |
{ | |
$gender = 0; // female - , + male | |
$letters = array( |
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
@media all and (max-width: 300px) { | |
} |
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
html { | |
color: #444; | |
background: #FDFDFF; | |
font-family: 'Helvetica Neue', HelveticaNeue, sans-serif; | |
font-size: 16px; | |
line-height: 1.618em; | |
margin: 0 auto; | |
max-width: 50em; | |
text-rendering: optimizeLegibility; | |
} |
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
jQuery('a[href*=".amazon."]').click(function(){ | |
_gaq.push(['_trackPageview', '/aff/'.jQuery(this).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
#toc li { | |
font-size: 80%; | |
line-height: 1; | |
} | |
#toc .h2 { | |
font-size: 90%; | |
} | |
#toc .h3 { | |
font-size: 70%; | |
margin-left: 1em; |
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
// Add 'first' class to intro text in #post-content container | |
$('#post-content>p:not(:has(img))').eq(0).addClass('first'); |
OlderNewer