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:1026646
Created June 15, 2011 07:32
SublimeVideo: HTTP/HTTPS Switcher
<script type="text/javascript">document.write(unescape("%3Cscript src='" + (("https:" == document.location.protocol) ? "https://4076.voxcdn.com" : "http://cdn.sublimevideo.net") + "/js/YOUR_TOKEN.js' type='text/javascript'%3E%3C/script%3E"));</script>
@rymai
rymai / gist:1042486
Created June 23, 2011 12:57
SublimeVideo: Interactive thumbnails HTML markup
<div id="interactive">
<div class="video_wrap">
<video id="video1" class="sublime" poster="posterframe1.jpg"
width="640" height="360" preload="none">
<source src="video1.mp4" />
<source src="video1.webm" />
<source src="video1.ogv" />
</video>
</div>
<div class="video_wrap">
@rymai
rymai / gist:1042487
Created June 23, 2011 12:58
SublimeVideo: Interactive thumbnails CSS rules
#interactive .video_wrap {
width:640px;
height:360px;
display:none;
}
#interactive .video_wrap.active {
display:block;
}
#interactive li.active {
background:#000;
@rymai
rymai / gist:1042916
Created June 23, 2011 16:27
SublimeVideo: Custom play button HTML markup
<img id="posterframe_video1" class="custom_play_button" src="posterframe.jpg" width="640" height="360" />
<video id="video1" style="display:none;" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.ogv" />
</video>
@rymai
rymai / gist:1043003
Created June 23, 2011 17:07
SublimeVideo: Simple video tag
<video class="sublime" poster="posterframe.jpg" width="640" height="360" preload="none">
<source src="video.mp4" />
<source src="video.webm" />
<source src="video.ogv" />
</video>
@rymai
rymai / gist:1043231
Created June 23, 2011 18:39
SublimeVideo: Custom play button JavaScript code (Prototype)
sublimevideo.ready(function() {
$$("img.custom_play_button").each(function(img) {
img.on("click", function(event) {
event.stop();
// Hide the posterframe and prepare and play the video
sublimevideo.prepareAndPlay(img.readAttribute("id").replace(/^posterframe_/, ""));
img.hide();
}.bind(this));
}.bind(this));
});
@rymai
rymai / gist:1114054
Created July 29, 2011 15:36
Watch any folder, from anywhere (new Guard CLI options, in the next release)!

In ~/prison, you put the Guardfile that describe which files to watch for changes and what to execute once a file is modified.

guard 'shell' do
  watch(%r{^.+\.txt$}) { |m| `echo #{File.join(::Guard.listener.directory, m[0])}` }
end

In ~/watch_from_here, you put the Gemfile that list the guards you want to use.

@rymai
rymai / gist:1142414
Created August 12, 2011 16:31
Can't call the lower SQL function
# https://github.com/ernie/squeel/issues/42
NoMethodError: undefined method `with_connection' for ActiveRecord::Base:Class
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/rails-d9d78d4165d1/activerecord/lib/active_record/base.rb:1082:in `method_missing'
from /Users/remy/my_project/vendor/ruby/1.9.1/gems/arel-2.2.0/lib/arel/visitors/to_sql.rb:16:in `accept'
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/squeel-788d71821d5b/lib/squeel/visitors/base.rb:85:in `quote'
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/squeel-788d71821d5b/lib/squeel/visitors/predicate_visitor.rb:342:in `quote_for_node'
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/squeel-788d71821d5b/lib/squeel/visitors/predicate_visitor.rb:101:in `visit_Squeel_Nodes_Predicate'
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/squeel-788d71821d5b/lib/squeel/visitors/base.rb:97:in `visit'
from /Users/remy/my_project/vendor/ruby/1.9.1/bundler/gems/squeel-788d71821d5b/lib/squeel/visitors/pre
@rymai
rymai / Guardfile
Created October 11, 2011 22:16
Guard::Vagrant + Guard::PhpUnit
guard :vagrant, :cwd => '/custom/cwd'
guard :phpunit, :vagrant => true do
watch %r{^website/application/(.+)\.php}
watch %r{^website/tests/unit/(.+)\.php}
watch 'website/tests/unit/phpunit.xml'
end
@rymai
rymai / magnifying_glass.css
Created May 30, 2012 10:35
SublimeVideo lightbox with magnifying glass using the WordPress plugin
a.zoomable {
display:block;
width:180px;
height:76px;
background:#000;
position:relative;
-webkit-box-shadow:rgba(0,0,0,0.4) 0 4px 10px;
-moz-box-shadow:rgba(0,0,0,0.4) 0 4px 10px;
box-shadow:rgba(0,0,0,0.4) 0 4px 10px;
}