Skip to content

Instantly share code, notes, and snippets.

@gaboesquivel
gaboesquivel / placeholder.js
Created Apr 2, 2012 — forked from senko/placeholder.js
HTML input field placeholder handling
View placeholder.js
/* Hide/show placeholder text in an input field while it's empty
* To use, add data-placheholder="placeholder text" to your fields
* Eg: <input type="text" id="email" value="" data-placeholder="Enter your e-mail">
*/
$('input[data-placeholder]').each(function(){
$(this)
.bind('focus', function() {
if ($(this).val() == $(this).data('placeholder'))
$(this).val('');
})
@gaboesquivel
gaboesquivel / gist:3501630
Created Aug 28, 2012 — forked from anonymous/gist:2523336
Changing author info
View gist:3501630
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]
View road_to_college.js.coffee
cycle_rtc = (e) ->
$(e).cycle
fx: "fade"
speed: 'fast'
timeout: 0
next: '.next'
prev: '.prev'
pager: '#rtc_pager ul'
pagerEvent: "click"
after: on_after
View _road_to_college.html.haml
:coffeescript
window.RTC = {}
RTC.completedSteps = #{ current_user.rtc_completed_steps rescue [] }
%section#rtc_container.tabs_container{ class: current_locale }
#slider_arrow
.prev.arrow
- if current_user && can?(:update, profile)
.next.arrow
-elsif !current_user || (current_user && current_user.profile.id != profile.id)
View controller_helpers.rb
module AbTests::ControllerHelpers
# def randomize_ab_version
# Random.rand(2) == 0 ? "current" : "rtc"
# end
# def get_ab_version
# if params[:ab_version]
# cookies[:ab_version] = params[:ab_version]
# else
@gaboesquivel
gaboesquivel / controller_helpers.rb
Created Nov 8, 2012
Esto tambien lo soluciona.....
View controller_helpers.rb
module AbTests::ControllerHelpers
def randomize_ab_version
"rtc"
end
def get_ab_version
if params[:ab_version]
cookies[:ab_version] = params[:ab_version]
else
View _add_to_favorites_counter.html.haml
- state = instance.favorite?(current_user) ? "favorite" : "not_favorite"
- position != 'right'
#awesome_counter{class: [position, state, "#{instance.id}_#{instance.class.to_s.parameterize}"], "data-entry-id" => "#{instance.class.to_s.parameterize}_#{instance.id}", "data-current_user" => current_user.blank? ? 'false' : 'true', "data-state" => state}
%span
.favorite_count
- if state == "favorite"
.counter.favorite
= instance.favorites.count
= image_tag "awesome/awesome-counter-save.png"
.state.hide
View _add_to_favorites_counter.html.haml
- state = instance.favorite?(current_user) ? "favorite" : "not_favorite"
- position |= 'right'
#awesome_counter{class: [position, state, "#{instance.id}_#{instance.class.to_s.parameterize}"], "data-entry-id" => "#{instance.class.to_s.parameterize}_#{instance.id}", "data-current_user" => current_user.blank? ? 'false' : 'true', "data-state" => state}
%span
.favorite_count
- if state == "favorite"
.counter.favorite
= instance.favorites.count
= image_tag "awesome/awesome-counter-save.png"
.state.hide
View mixins.sass
@mixin main_tabs_properties($image, $color: $grayLight)
width: 130px
a
background:
image: $image
repeat: no-repeat
&.ui-tabs-selected, &:hover
a
background-position: -8px 10px
&.ui-tabs-selected
View dabblet.css
/**
* 3D Now In Beta Ribbon
*/
/*@font-face {
font-family: Collegiate;
src: url("Collegiate.ttf");
}*/
.ribbon-holder {