Skip to content

Instantly share code, notes, and snippets.

Laurent Prévost Prevole

Block or report user

Report or block Prevole

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Gruntfile.js
'use strict';
module.exports = function(grunt) {
probedockSetup: {
all: {}
probedockPublish: {
all: {}
View Structure.txt
Prevole / mymodel_factory.rb
Created Nov 14, 2011
Shoulda-Matchers + RSpec
View mymodel_factory.rb
require ".../mymodel"
FactoryGirl.define do
factory :mymodel, :class => MyModel do |m|
Prevole / gemfile
Created Mar 9, 2012
Rails + Rspec + Capybara + Selenium
View gemfile
group :development, :test do
# RSpec
gem "rspec-rails"
gem "factory_girl_rails"
gem "database_cleaner"
gem "shoulda-matchers", :git => ""
gem "capybara"
# Spork
gem "spork-rails"#, "> 0.9.0.rc"
Prevole / somefile.rb
Created Mar 28, 2012
Yard documentation
View somefile.rb
classe MyClass < ActionView::Helpers::FormBuilder
# Some text
# @param [String|Symbol] name Some text too
# @param [Hash] *args Options
# @option *args [Boolean ]:option_name Option description
%w[text_field password_field].each do |method_name|
define_method(method_name) do |name, *args|
# ... some code there ...
View admin_controller.rb
module Admin
class AdminController < ApplicationController
def initialize
@datatable_class = "#{self.class.to_s.gsub("Controller", "Datatable")}".constantize
@model_class = "Object::#{self.class.to_s.gsub("Admin::", "").gsub("Controller", "").singularize}".constantize
@param_path = "#{@model_class.to_s.gsub("::", "_").downcase}"
@model_name = "#{@model_class.to_s.demodulize.downcase}"
Prevole / backbone-bundle.gemspec
Created Aug 21, 2012
Rails plugin with only assets
View backbone-bundle.gemspec
$:.push File.expand_path("../lib", __FILE__)
# Maintain your gem's version:
require "backbone-bundle/version"
# Describe your gem and declare its dependencies: do |s| = "backbone-bundle"
s.version = BackboneBundle::VERSION
s.authors = ["Prevole"]
Prevole / main.js
Created Aug 23, 2012
Sort of data grid with Backbone + Marionette (with a rails backend)
View main.js
// JST and HAML Assets is used for the templating pre-compilation
Backbone.Marionette.Renderer.render = function(template, data) {
if (!JST[template]) {
throw "Template '" + template + "' not found!";
return JST[template](data);
window.MyApp = new Backbone.Marionette.Application();
You can’t perform that action at this time.