Skip to content

Instantly share code, notes, and snippets.

View AlexJWayne's full-sized avatar
🌈

Alex Wayne AlexJWayne

🌈
View GitHub Profile
module HasRelations
module ClassMethods
def has_relations
include InstanceMethods
has_many :relations, :as => :from
end
end
module InstanceMethods
def related(relation_type = nil)
<object id="flashObj" width="640" height="384" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"><param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" /><param name="base" value="http://admin.brightcove.com" /><param name="seamlesstabbing" value="false" /><param name="allowFullScreen" value="true" /><param name="swLiveConnect" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" bgcolor="#FFFFFF" flashVars="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" base="http://admin.brightcove.com" name="flashObj" width="640" height="384" seamlesstabbing="false" type="application/x-shockwa
<object id="flashObj" width="612" height="387" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"><param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" /><param name="base" value="http://admin.brightcove.com" /><param name="seamlesstabbing" value="false" /><param name="allowFullScreen" value="true" /><param name="swLiveConnect" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" bgcolor="#FFFFFF" flashVars="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" base="http://admin.brightcove.com" name="flashObj" width="612" height="387" seamlesstabbing="false" type="application/x-shockwa
<object id="flashObj" width="612" height="387" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"><param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" /><param name="base" value="http://admin.brightcove.com" /><param name="seamlesstabbing" value="false" /><param name="allowFullScreen" value="true" /><param name="swLiveConnect" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" bgcolor="#FFFFFF" flashVars="@videoPlayer=26786444001&playerID=26806173001&domain=embed&" base="http://admin.brightcove.com" name="flashObj" width="612" height="387" seamlesstabbing="false" type="application/x-shockwa
<object id="flashObj" width="612" height="387" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,47,0"><param name="movie" value="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" /><param name="bgcolor" value="#FFFFFF" /><param name="flashVars" value="@videoPlayer=27279662001&playerID=26806173001&domain=embed&" /><param name="base" value="http://admin.brightcove.com" /><param name="seamlesstabbing" value="false" /><param name="allowFullScreen" value="true" /><param name="swLiveConnect" value="true" /><param name="allowScriptAccess" value="always" /><embed src="http://c.brightcove.com/services/viewer/federated_f9/26806173001?isVid=1&publisherID=26269167001" bgcolor="#FFFFFF" flashVars="@videoPlayer=27279662001&playerID=26806173001&domain=embed&" base="http://admin.brightcove.com" name="flashObj" width="612" height="387" seamlesstabbing="false" type="application/x-shockwa
require 'rubygems'
require 'open-uri'
require 'hpricot'
def find_biggest_image_url(url)
page = Hpricot(open(url))
biggest_image_url = nil;
biggest_image_area = 0;
// this is called by the internal API when the movie is done loading... we can find the MPItem
// from the user dictionary, and ask it for its duration (internal api)... we need the duration
// to find the halfway point
- (void)_movieDidPreload:sender {
NSDictionary *dict = [sender userInfo];
id item = [dict objectForKey:@"AVController_Item"];
[self prepareCRS:[item duration]];
[(id)super _movieDidPreload:sender];
}
//
// VideoPlayerController.m
// Beezag
//
// Created by Alex Wayne on 8/27/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "VideoPlayerController.h"
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>hal9000.say { render :js => 'Hello Dave.' }</title>
<%= javascript_include_tag :defaults %>
</head>
<body>
<fieldset>
<legend>This is where the test happens</legend>
<%= yield %>
production:
adapter: mysql
encoding: utf8
database: holopoint_production
username: dbuser
password: ***snipped***
host: 127.0.0.1
socket: /var/lib/mysql/mysql.sock
worker: