Skip to content

Instantly share code, notes, and snippets.

Avatar
📊

Harrison Shoff hshoff

📊
View GitHub Profile
@hshoff
hshoff / Blackbored.xml
Created Feb 1, 2011
Textmate's Blackboard color theme cloned (kind-of) for RubyMine.
View Blackbored.xml
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Blackbored" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.25" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Monaco" />
<colors>
<option name="ANNOTATIONS_COLOR" value="3e83e7" />
<option name="CARET_COLOR" value="" />
<option name="CARET_ROW_COLOR" value="40436" />
<option name="CONSOLE_BACKGROUND_KEY" value="0" />
@hshoff
hshoff / Blackbored2.xml
Created Feb 5, 2011
Textmate's Blackboard theme for RubyMine round 2.
View Blackbored2.xml
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Blackbored" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.25" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Monaco" />
<colors>
<option name="ANNOTATIONS_COLOR" value="3e83e7" />
<option name="CARET_COLOR" value="" />
<option name="CARET_ROW_COLOR" value="40436" />
<option name="CONSOLE_BACKGROUND_KEY" value="0" />
@hshoff
hshoff / StarRatingMarkup.html.erb
Created Oct 14, 2011
Airbnb - Star Rating Markup by Harry Shoff
View StarRatingMarkup.html.erb
<div class="empty">
<div class="filled"></div>
</div>
@hshoff
hshoff / StarRatingMarkup2.html.erb
Created Oct 14, 2011
Airbnb - Star Rating Markup Namespace by Harry Shoff
View StarRatingMarkup2.html.erb
<!-- stars.html.erb -->
<div class="stars empty">
<div class="stars filled"></div>
</div>
<!--
This way you can namespace your selectors.
The markup isn't as pretty, but you can
sleep soundly knowing other developers
@hshoff
hshoff / stars.scss
Created Oct 14, 2011
Airbnb - Star Rating SASS
View stars.scss
// stars.scss
// compiles to stars.css
$starWidth: 44px;
$starOffset: 0 -43px;
$numStars: 5;
$steps: 2;
$total: $numStars * $steps;
@mixin filled($n: 0) {
@hshoff
hshoff / StarRating3.html.erb
Created Oct 14, 2011
Airbnb - Star Rating Markup with Rating by Harry Shoff
View StarRating3.html.erb
<!-- stars.html.erb -->
<div class="stars empty">
<div class="stars filled_<%= @obj.rating %>"></div>
</div>
@hshoff
hshoff / stars.css
Created Oct 14, 2011
Airbnb - Star Rating Generated CSS by Harry Shoff
View stars.css
.stars {
background: url(/images/sprite.png) repeat-x top left;
height: 43px; }
.stars.empty {
background-position: 0 -43px;
width: 220px; }
.stars.filled_0 {
width: 0px; }
.stars.filled_1 {
width: 22px; }
View Your_Router.coffee
class Router extends Backbone.Router
routes:
'listings/:id': 'listing'
listing: (id) ->
# update content
@hshoff
hshoff / init.coffee
Created Feb 21, 2012
Nice way to initialize Backbone.Views
View init.coffee
Backbone.Component extends Backbone.View
initialize: ->
for func, args of @options
unless _.isArray(args)
@[func]?.call(@, args)
else
@[func]?.apply(@, args)
render: =>
@hshoff
hshoff / init.coffee
Created Feb 21, 2012
A nice way to initialize
View init.coffee
class Component extends Backbone.View
initialize: ->
for func, args of @options
unless _.isArray(args)
@[func]?.call(@, args)
else
@[func]?.apply(@, args)
return null
You can’t perform that action at this time.