Skip to content

Instantly share code, notes, and snippets.

View rymai's full-sized avatar
🙌
Working from home

Rémy Coutable rymai

🙌
Working from home
View GitHub Profile
@rymai
rymai / gist:925199
Created April 18, 2011 12:02
SublimeVideo: Add a shadow around the video tag (snippet)
<!-- Inside the <head> tag -->
<style type="text/css">
.sublimevideo_shadow_box {
-webkit-box-shadow:rgba(0,0,0,0.5) 0 3px 15px;
-moz-box-shadow:rgba(0,0,0,0.5) 0 3px 15px;
box-shadow:rgba(0,0,0,0.5) 0 3px 15px;
}
</style>
<!-- Inside the <body> tag -->
@rymai
rymai / gist:925086
Created April 18, 2011 09:40
SublimeVideo: Back to poster-frame JavaScript code
// From the documentation: http://docs.sublimevideo.net/javascript-api#onEnd
// You can use sublimevideo.onEnd() to restore the video to its initial state
// (that shows the poster frame and the play button) automatically when the video ends:
sublimevideo.ready(function(){
sublimevideo.onEnd(function(sv){
sublimevideo.stop();
});
});
@rymai
rymai / gist:925078
Created April 18, 2011 09:33
SublimeVideo: Custom play button JavaScript code (jQuery)
sublimevideo.ready(function() {
$("img.custom_play_button").each(function() {
$(this).click(function(event) {
event.preventDefault();
// Hide the posterframe and prepare and play the video
sublimevideo.prepareAndPlay($(this).attr("id").replace(/^posterframe_/, ""));
$(this).hide();
});
});
});
@rymai
rymai / gist:924995
Created April 18, 2011 08:34
SublimeVideo: Interactive thumbnails JavaScript code (Prototype)
var SublimeVideo = SublimeVideo || {};
var InteractiveThumbnailsHandler = Class.create({
initialize: function(interactiveWrapperId) {
this.interactiveWrapperId = interactiveWrapperId;
this.videosCount = $$("#" + interactiveWrapperId + " .video_wrap").size();
$$("#" + this.interactiveWrapperId + " li").each(function(thumb) {
thumb.on("click", function(event) {
event.stop();
@rymai
rymai / gist:924988
Created April 18, 2011 08:30
SublimeVideo: Interactive thumbnails JavaScript code (jQuery)
var SublimeVideo = SublimeVideo || {};
var InteractiveThumbnailsHandler = function(interactiveWrapperId){
this.interactiveWrapperId = interactiveWrapperId;
this.videosCount = $("#" + this.interactiveWrapperId + " .video_wrap").size();
this.setup();
};
$.extend(InteractiveThumbnailsHandler.prototype, {
setup: function() {
@rymai
rymai / gist:921532
Created April 15, 2011 11:09
SublimeVideo: Autoplay and loop (snippet)
<!-- Inside the <head> tag -->
<script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script>
<!-- Inside the <body> tag -->
<video id="video1" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.ogv" />
</video>
<!-- Just before </body> (or in the <head> tag) -->
@rymai
rymai / gist:921421
Created April 15, 2011 08:54
SublimeVideo: Video "On Demand" (snippet)
<!-- Inside the <head> tag -->
<script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script>
<!-- Inside the <body> tag -->
<img class="needs_sublime" src="video1.jpg" width="640" height="360" />
<!-- Just before </body> (or in the <head> tag) -->
<script type="text/javascript">
sublimevideo.load(); // When this page is first loaded there are no <video> element on the page, so SublimeVideo is not loaded unless we load it manually with this method
// see: http://docs.sublimevideo.net/javascript-api#load
@rymai
rymai / gist:919915
Created April 14, 2011 16:54
SublimeVideo: Autoplay (snippet)
<!-- Inside the <head> tag -->
<script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script>
<!-- Inside the <body> tag -->
<video id="video1" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.ogv" />
</video>
<!-- Just before </body> (or in the <head> tag) -->
@rymai
rymai / gist:919105
Created April 14, 2011 08:09
SublimeVideo: Loop (snippet)
<!-- Inside the <head> tag -->
<script type="text/javascript" src="http://cdn.sublimevideo.net/js/YOUR_TOKEN.js"></script>
<!-- Inside the <body> tag -->
<video class="sublime" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.ogv" />
</video>
<!-- Just before </body> (or in the <head> tag) -->
@rymai
rymai / Guardfile
Created December 13, 2010 22:57
When a controller file is modified, it will execute the associated: - routing spec, - controller spec, - acceptance spec
# When a controller file is modified, it will execute the associated:
# - routing spec,
# - controller spec,
# - acceptance spec
guard 'rspec' do
watch(%r|app/controllers/(.*)_controller\.rb|) do |m|
["spec/routing/#{m[1]}_routing_spec.rb",
"spec/controllers/#{m[1]}_controller_spec.rb",
"spec/acceptance/#{m[1]}_spec.rb"]
end