This file contains hidden or 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
var $stuff = $('#stuff'), | |
temp_items = document.createDocumentFragment(), | |
temp_item = null; | |
$.each(('this is an array of things that will get added to $stuff').split(' '), function(i, item) { | |
temp_item = $('<li />', { | |
text: item | |
})[0]; | |
temp_items.appendChild(temp_item); |
This file contains hidden or 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 for( $i = 0; $i < 9; $i++ ) : ?> | |
<p><?php echo cycle('one', 'two', 'three') ?></p> | |
<?php endfor; ?> |
This file contains hidden or 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 link_to_with_notifications(*args, &block) | |
# get notification count from hash | |
notifications = args[2][:notifications] || 0 | |
# create the data- attribute unless notifications.zero? | |
args[2]['data-notifications'] = notifications unless notifications.zero? | |
# delete original notifications hash | |
args[2].delete(:notifications) |
This file contains hidden or 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
<ol> | |
<li> | |
<a data-notifications="10" class="button" href="#">New Comments on Your Posts</a> | |
</li> | |
<li> | |
<a class="button" href="#">Number of Post Likes :)</a> | |
</li> | |
<ol> |
This file contains hidden or 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 | |
class Benchmark { | |
/** | |
* Creates a loop that lasts for $allowed_time and logs how many | |
* times a function was able to run | |
* | |
* @param string $name the name of the test | |
* @param function $test the function to run |
This file contains hidden or 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 include 'flash.php'; ?> | |
... | |
<?php foreach( Flash::$messages as $id => $msg ) : ?> | |
<div class="flash_<?php echo $id ?>"><?php echo $msg ?></div> | |
<?php endforeach; ?> |
This file contains hidden or 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
// http://obvcode.blogspot.com/2007/11/easiest-way-to-check-ie-version-with.html | |
var Browser = { | |
version: function() { | |
var version = 999; // we assume a sane browser | |
if (navigator.appVersion.indexOf("MSIE") != -1) { | |
// bah, IE again, lets downgrade version number | |
version = parseFloat(navigator.appVersion.split("MSIE")[1]); | |
} | |
return version; |
This file contains hidden or 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 | |
class DocBlock { | |
public $docblock, | |
$description = null, | |
$all_params = array(); | |
/** | |
* Parses a docblock; |
This file contains hidden or 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 { | |
list-style: none; | |
} | |
li { | |
margin-bottom: 20px; | |
} | |
a { | |
display: block; |
This file contains hidden or 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
/* | |
Search Suggestions | |
Original design by Visual Idiot - http://dribbble.com/shots/377281-Search-Suggestions | |
*/ | |
html { | |
min-height: 100%; | |
background: -webkit-linear-gradient(#dbddde, #b6babb); | |
font-family: Helvetica Neue, Helvetica, Arial, sans-serif; | |
-webkit-font-smoothing: antialiased; |