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 / 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;
}
@rymai
rymai / Gemfile.lock
Created October 5, 2018 11:43
Gemfile.lock
GIT
remote: https://github.com/jtapia/solidus_mailchimp_sync.git
revision: ee766bac790d38f18b56ac33bfad73b818a0c8f9
specs:
solidus_mailchimp_sync (1.0.0.beta06)
deface (~> 1.0)
http (~> 2.0)
solidus_core (>= 1.4, < 3)
solidus_support
@rymai
rymai / gist:6620991
Last active December 23, 2015 10:19 — forked from lucascaton/gist:3605012
RSpec's New Expectation Syntax - migration script
# Include this in your spec_helper.rb:
config.expect_with :rspec do |c|
c.syntax = :expect
end
# Then, run:
find spec -name "*.rb" -exec gsed -i -e "s/\(\s\+\)\(.*\)\.should_not /\1expect(\2).not_to /g" -e "s/\(\s\+\)\(.*\)\.should /\1expect(\2).to /g" -e "s/\(\s\+\)\(.*\)\.should_receive/\1expect(\2).to receive/g" -e "s/\(\s\+\)\(.*\)\.should_not_receive/\1expect(\2).to_not receive/g" "{}" \;
# About RSpec's New Expectation Syntax
@rymai
rymai / application.js
Created January 18, 2013 09:59
This is the script I use on http://everyday.rymai.me that allows you to move from one image to another while in lightbox mode. It requires jQuery (http://jquery.com) and Mousetrap (http://craig.is/killing/mice). Demo: http://everyday.rymai.me Notes: The *.js.coffee files should be pre-compiled by Sprockets (https://github.com/sstephenson/sprockets
// This code is the automatic conversion to JS of photos_carousel.js.coffee + application.js.coffee.
// Performed on http://coffeescript.org (click on the "TRY COFFEESCRIPT" tab).
var PhotosCarousel;
PhotosCarousel = (function() {
function PhotosCarousel(lightboxes) {
this.lightboxes = lightboxes;
this.currentIndex = 0;
this.setupObservers();
@rymai
rymai / Guardfile
Created June 5, 2012 21:48
Trying to detect a Guard/Listen issue with folder that contains a '$' ( https://github.com/guard/guard/issues/287 )
guard 'shell' do
watch(/.+/) { |m| puts m }
end
@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 / 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 / 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: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: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>