Skip to content

Instantly share code, notes, and snippets.

View hshoff's full-sized avatar
📊

Harrison Shoff hshoff

📊
View GitHub Profile
@hshoff
hshoff / Blackbored.xml
Created February 1, 2011 22:21
Textmate's Blackboard color theme cloned (kind-of) for RubyMine.
<?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 February 5, 2011 01:11
Textmate's Blackboard theme for RubyMine round 2.
<?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 October 14, 2011 12:52
Airbnb - Star Rating Markup by Harry Shoff
<div class="empty">
<div class="filled"></div>
</div>
@hshoff
hshoff / StarRatingMarkup2.html.erb
Created October 14, 2011 12:58
Airbnb - Star Rating Markup Namespace by Harry Shoff
<!-- 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 October 14, 2011 13:53
Airbnb - Star Rating SASS
// 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 October 14, 2011 14:28
Airbnb - Star Rating Markup with Rating by Harry Shoff
<!-- stars.html.erb -->
<div class="stars empty">
<div class="stars filled_<%= @obj.rating %>"></div>
</div>
@hshoff
hshoff / stars.css
Created October 14, 2011 14:58
Airbnb - Star Rating Generated CSS by Harry Shoff
.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; }
class Router extends Backbone.Router
routes:
'listings/:id': 'listing'
listing: (id) ->
# update content
@hshoff
hshoff / init.coffee
Created February 21, 2012 07:35
Nice way to initialize Backbone.Views
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 February 21, 2012 07:51
A nice way to initialize
class Component extends Backbone.View
initialize: ->
for func, args of @options
unless _.isArray(args)
@[func]?.call(@, args)
else
@[func]?.apply(@, args)
return null