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
/* | |
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; |
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 { | |
list-style: none; | |
} | |
li { | |
margin-bottom: 20px; | |
} | |
a { | |
display: block; |
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 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 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 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 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 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 PubSub { | |
private static $events = array(); // all subscriptions | |
// Don't allow PubSub to be initialized outside this class | |
private function __construct() {} | |
private function __clone() {} |
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
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 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 | |
// Allows multiple __autoload stacks | |
// and keeps autoloader in Huck class | |
spl_autoload_register(array('Huck', 'autoload')); | |
class Huck { | |
public static function autoload($class_name) { | |
if( substr($class_name, 0, 5) === 'Huck_' ) { |
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
<label> | |
<input type="checkbox"> | |
Is this awesome? | |
</label> |