Skip to content

Instantly share code, notes, and snippets.

View bazzel's full-sized avatar

Patrick Baselier bazzel

  • Oisterwijk, The Netherlands
View GitHub Profile
@bazzel
bazzel / Gemfile
Created May 19, 2012 05:45
Capistrano's deploy.rb with RVM multi user install
gem 'capistrano'
gem 'rvm-capistrano'
@bazzel
bazzel / _curled_page.css.scss
Created November 11, 2012 10:15
Compass mixin for creating a curled page
// Inspiration: http://nicolasgallagher.com/css-drop-shadows-without-images/demo/
@import 'compass/css3';
@import 'compass/typography/vertical_rhythm';
// Creates a curled-page.
//
// $corner - [default:$top-left] ( top-left | top-right | bottom-right | bottom-left) Corner to curl
// $direction - [default:$vertical] ( vertical | horizontal )
//
// Example:
@bazzel
bazzel / ember-infinite-scroll.js.coffee
Created February 9, 2014 21:06
Infinite scroll with Ember.js and Ruby on Rails - These Ember Mixins are used by my Rails template for setting up infinite scrolling with Ember.js and Ruby on Rails. The template is located here https://github.com/bazzel/rails-templates/blob/master/ember-infinite-scroll.rb
InfiniteScroll =
ControllerMixin: Ember.Mixin.create(
hasMore: (->
@meta('page') < @meta('total_pages')
).property('@each')
meta: (key) ->
@store.metadataFor(@_type())[key]
loadMore: ->
@bazzel
bazzel / ember-list-view.js.coffee
Last active August 29, 2015 13:56
Ember.ListView mixins - for changing height and width of Ember.ListView during runtime
# This mixin can be used to extend a ListView class to adjust its width and height when resizing
# the browser. The dimensions of the ListView are synchronized with the width and height
# of the parent element that contains the ListView.
#
# Although this mixin sets the width and height you still have to define these properties when
# defining the ListView class.
#
# example:
# App.ListView = Ember.ListView.extend ListView.ListViewMixin,
# width: 100
<header class='landing'>
<img src='images/logo.png'>
</header>
<section class='landing-wrapper'>
<div class='landing-content'>
<h1 class='section-heading'>Ember <em>work</em>Shop</h1>
<p class='lead'>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid, suscipit, rerum quos facilis repellat architecto commodi officia atque nemo facere eum non illo voluptatem quae delectus odit vel itaque amet.</p>
</div>
<div class="jumbotron">
<h1>Ember <em>work</em>Shop</h1>
<p>Select a product to view the details.</p>
</div>
<form role='form' class='well'>
<div class='form-group'>
{{input value=title class='form-control' placeholder='Enter a title'}}
</div>
<div class='form-group'>
{{textarea value=description class='form-control' placeholder='Enter a description'}}
</div>
<div class='form-group'>
{{input value=price class='form-control' type='number' placeholder='Enter a price'}}
</div>
<div class='form-group'>
{{#if image}}
<img {{bind-attr src=image}}/>
<button type='button' class='remove pull-right'>Remove</button>
{{else}}
<img src='http://placehold.it/320x150&text=No image'>
{{/if}}
<div class='file'>
Browse...<input type='file' accept='image/*'>
</div>
import Ember from 'ember';
export default Ember.ObjectController.extend({
isEditing: false,
actions: {
toggleEditing: function() {
this.toggleProperty('isEditing');
this.resetModel();
},
submit: function() {
{{#each starred}}
<span class="glyphicon glyphicon-star"></span>
{{/each}}
{{#each unstarred}}
<span class="glyphicon glyphicon-star-empty"></span>
{{/each}}