Skip to content

Instantly share code, notes, and snippets.

View BaylorRae's full-sized avatar

Baylor Weathers BaylorRae

View GitHub Profile
@BaylorRae
BaylorRae / dabblet.css
Created March 7, 2012 16:18
Search Suggestions
/*
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;
ul {
list-style: none;
}
li {
margin-bottom: 20px;
}
a {
display: block;
<?php include 'flash.php'; ?>
...
<?php foreach( Flash::$messages as $id => $msg ) : ?>
<div class="flash_<?php echo $id ?>"><?php echo $msg ?></div>
<?php endforeach; ?>
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)
<?php for( $i = 0; $i < 9; $i++ ) : ?>
<p><?php echo cycle('one', 'two', 'three') ?></p>
<?php endfor; ?>
<?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
<?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() {}
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);
<?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_' ) {
<label>
<input type="checkbox">
Is this awesome?
</label>