Skip to content

Instantly share code, notes, and snippets.

View dbackeus's full-sized avatar

David Backeus dbackeus

View GitHub Profile
@dbackeus
dbackeus / playlist_videos.json
Created November 8, 2011 09:53
Playlist Videos
[
{
"aspect_ratio_multiplier":1.7777777777777777,
"created_at":"2011-02-09T16:13:41Z",
"duration":21.9,
"plays":34,
"progress":1.0,
"state":"ready",
"tags": ["Teaser", "System-Demo"],
"title":"Streamio 20th Century Fox Teaser",
@dbackeus
dbackeus / playlist.json
Created November 8, 2011 09:50
Playlist
{
"id":"4e809a4d5412901074000038",
"title":"My published videos",
"order_by":"_id",
"order_direction":"desc",
"tags":["Published"],
"created_at":"2011-09-26T15:29:17Z",
"updated_at":"2011-10-13T14:05:30Z",
"account_id":"4e809a4d5412901074000152"
}
@dbackeus
dbackeus / playlists.json
Created November 8, 2011 09:44
Playlist List
[
{
"id": "4e809a4d5412901074000038",
"title": "My latest published videos",
"tags": ["Published"],
"order_by": "_id",
"order_direction": "desc",
"created_at": "2011-09-26T15:29:17Z",
"updated_at": "2011-10-13T14:05:30Z"
}
@dbackeus
dbackeus / player_public_show.html
Created October 27, 2011 10:49
Playlist Player Public Show View
<div class="container">
<h1 class="player-title">[player-title]</h1>
<h2 class="video-title">[selected video-title]</h2>
<ul class="playlist-list [many/single - depending if there are many playlists assigned or not]">
<!-- A list element will be created for every playlist assigned to the player -->
<li class="playlist-row [even/odd - alternating for zebra styling] [current - on the currently selected playlist]" data-playlist-id="[playlist-id]">
<span class="title"><a href="#" onclick="[method-for-loading-playlist]">[playlist-title]</a></span>
</li>
<!-- the list ends with a 'last' li useful for clearing if you're using float for the playlist-rows -->
<li class="last"></li>
@dbackeus
dbackeus / bundler-error.md
Created September 29, 2011 09:17
Bundler error details

Gemfile

source 'http://rubygems.org'

gem 'rails', '3.0.10'

# Essential
gem "devise"
@dbackeus
dbackeus / frozen.rb
Created August 22, 2011 09:31
Referenced document frozen on childs after_destroy callback
class Parent
include Mongoid::Document
field :something, :type => String
has_many :children
after_create :create_child
private
def create_child
children.create
end
@dbackeus
dbackeus / linebreaks.rb
Created August 16, 2011 15:46
linebreaks etc
# Statement are seperated by line breaks
def my_method
"hello"
end
# You can put several statements on one line if...
def my_method; "hello"; end
# After an operator...
1 +
@dbackeus
dbackeus / disappeared_parent.rb
Created August 16, 2011 13:35
Disappeared parent in child after_destroy
class Parent
include Mongoid::Document
embeds_many :children
before_create :create_child
private
def create_child
children.build
end
end
@dbackeus
dbackeus / count.json
Created August 11, 2011 11:38
Streamio API Count
{ "count": 23 }
@dbackeus
dbackeus / referenced_object_fail.rb
Created August 8, 2011 10:39
Referenced object in callback fail
class Parent
include Mongoid::Document
has_many :children
end
class Child
include Mongoid::Document
belongs_to :parent