Skip to content

Instantly share code, notes, and snippets.

endSession: ->
do restartSession = ->
restartSessionTimer = setTimeout ->
window.location.href = Etaxi.config.base_url
, Etaxi.config.user_session_length
do showRestartSessionAlert = ->
showRestartSessionAlertTimer = setTimeout ->
$z("#notification").animate
item = $z(e.currentTarget)
screen_center_x = $z(window).width() / 2
screen_center_y = $z(window).height() / 2
move_to_x = screen_center_x - item.data("screen-offset-x")
move_to_y = screen_center_y - item.data("screen-offset-y")
# Problem: This returns "true" or "false", instead of "-1000px" or "1000px"
item_origin = (item.data("screen-offset-y") > screen_center_y) ? "-1000px" : "1000px"
# THIS WORKS
# Videos Router
class Etaxi.Routers.Videos extends Backbone.Router
routes:
'' : 'videos'
'videos' : 'videos'
initialize: ->
Zencoder::Job.create({
:input => video.video,
:region => "europe",
:test => !Rails.env.production?,
:output => [
{
:type => "segmented",
:base_url => base_url,
:filename => "#{video.id}_low.m3u8".downscore,
:format => "ts",
describe Api::V1::DevicesController do
render_views
describe "GET" do
let!(:device) {
@time = Time.now
FactoryGirl.create(:device, pinged_at: @time)
}
# @news from news_controller#index
collection @news
attributes :id, :title, :excerpt, :content, :image, :source, :published_at, :created_at
node :excerpt do |news|
truncate(news.excerpt, :length => 100)
end
node :content do |news|
Bundler could not find compatible versions for gem "bootstrap-sass":
In Gemfile:
bootstrap-sass (~> 2.0.1) ruby
rails_admin (>= 0) ruby depends on
bootstrap-sass (2.1.0.0)
class Etaxi.Views.Videoplayer extends Backbone.View
template: JST['base/videoplayer']
tagName: "div"
id: "overlay-wrapper"
className: "videoplayer"
options:
title: "Video"
{
"id":
92,
"sponsored":
false,
"sponsored_content_url":
"",
"name":
"Schwedenplatz",
"description":
@drale2k
drale2k / CoreDataTableViewController.h
Created April 10, 2013 22:40
NSFetchedResultsController for UITableViewController
//
// CoreDataTableViewController.h
//
// Created for Stanford CS193p Winter 2013.
// Copyright 2013 Stanford University. All rights reserved.
//
// This class mostly just copies the code from NSFetchedResultsController's documentation page
// into a subclass of UITableViewController.
//
// Just subclass this and set the fetchedResultsController.