Skip to content

Instantly share code, notes, and snippets.

View ericdfields's full-sized avatar
🏠
Working from home in Baltimore, sometimes in DC

Eric Brookfield ericdfields

🏠
Working from home in Baltimore, sometimes in DC
View GitHub Profile
$controls.find('a').each(function(index){
var $this = $(this)
$this.data('active',false)
$this.bind('click',function(e){
e.preventDefault()
if (!$this.data('active')) {
$this.data('active',true)
switch (index) {
case 0:
// up
.new-deals-indicator {
-webkit-animation-name: gentleBounce;
-webkit-animation-duration: 3s;
-webkit-animation-timing-function: ease-in-out;
-webkit-animation-iteration-count: infinite;
}
@-webkit-keyframes gentleBounce {
0% {
@include translateY(0)
}
asdfasfd
$('#client_catalog-category-view').live('pagecreate',function(event){
// alert('This page was just enhanced by jQuery Mobile!');
viewToggles.init()
loadMore.init()
});
// Product Array - View as Toggles
var viewToggles = {
init: function() {
$('#filters_view-as').find('a').bind('click',function(e){
@ericdfields
ericdfields / gist:1022957
Created June 13, 2011 15:13
jQuery Mobile Sass for preventing flash of unstyled content when jqm is loaded outside of head
/* Prevents flash of unstyled content as jqm loads */
body {
background: black;
[data-role="page"] {
visibility: hidden;
}
}
.ui-mobile-viewport {
[data-role="page"] {
visibility: visible;
@for $i from 1 through 5 {
article:nth-child(2n + $i) {
top: $i*20px;
opacity: 0.5;
}
}
# my helper
def logged_in()
"\#{request.boolean_param(logged_in)}"
end
# my template code
<% if !logged_in %>
<script type="text/javascript" charset="utf-8">
alert('done')
</script>
@ericdfields
ericdfields / gist:1148199
Created August 16, 2011 00:24
Skeleton CSS-style Button Mixin via Sass & Compass (http://www.getskeleton.com/#buttons)
@mixin skeleton-button(
$old-browser-background: #eee,
$up-background:linear-gradient(rgba(255,255,255,.2),rgba(0,0,0,.25)),
$hover-background:linear-gradient(rgba(255,255,255,.3),rgba(0,0,0,.3)),
$active-background:linear-gradient(rgba(0,0,0,.3) 0%,rgba(255,255,255,.3)),
$up-color:#444,
$hover-color:#222,
$text-shadow: rgba(255,255,255,.75) 0 1px,
$font-size: 11px,
$font-weight: bold,
@mixin button-function(param,param,param) {
// does this
}
.button-default {
@include button-function();
}
.button-special {
@include button-function(param:defined);
}
$ rake spec --trace
** Invoke spec (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)