Skip to content

Instantly share code, notes, and snippets.

@gabriel-dehan
gabriel-dehan / thingy.rb
Created August 28, 2014 08:37
SocialThingyThing
def create
...
ExtractionWorker.perform_async(doc.path)
end
class ExtractionWorker
def perform(path)
social_data_extractor = ExtractSocialData.new(path)
raison_social = social_data_extractor.getSocialReason
@gabriel-dehan
gabriel-dehan / interface.rb
Created October 14, 2014 08:25
Shopping Cart Command Line Interface
require_relative "shopping"
# 1 - Elle doit proposer une liste d'articles avec leurs prix
puts "Welcome to The Wagon Market place !"
puts "-------"
MARKET.each do |name, price|
puts "#{name}: #{price} euros"
end
@gabriel-dehan
gabriel-dehan / Backlog
Last active August 29, 2015 14:07
GAAAAH IRC HELP ME PLS
{"collect_id"=>1, "email"=>"[email protected]", "password"=>"password", "action"=>"create", "controller"=>"api/users", "user"=>{"email"=>"[email protected]"}}
Failures:
1) Managing a collect's users as a facilitator for collect users add user to collect adds the user to the collect
Failure/Error: Unable to find matching line from backtrace
ActiveRecord::RecordNotFound:
Couldn't find Collect with 'id'=1
# ./app/controllers/api/users_controller.rb:49:in `set_parent'
@gabriel-dehan
gabriel-dehan / Backlog 2
Created October 22, 2014 07:43
Backlog 2
Run options: include {:locations=>{"./spec/integration/collect_edit_users_spec.rb"=>[62]}}
workshop: success for users
workshop: success for activities
success for users
F
Failures:
1) Managing a collect's users as a facilitator for collect users add user to collect adds the user to the collect
Failure/Error: Unable to find matching line from backtrace
Fluidity.Models.Collect = Backbone.Model.extend({
urlRoot: function() {
return "/api/collects";
},
initialize: function(attr, options) {
@gabriel-dehan
gabriel-dehan / equalizehashes.rb
Created December 3, 2014 22:29
Equalize two number hashes
Equalizes two hashes
#
# {"25-34"=>76, "35-44"=>16, "18-24"=>4, "65"=>4}
# {"35-44"=>6.0, "13-17"=>20.0, "18-24"=>59.4, "25-34"=>14.6}
#
# Equalize Hashes =>
@gabriel-dehan
gabriel-dehan / OLD
Created December 10, 2014 16:55
fdsfsd
li.post.postWeb class="post-#{post.id}"
- post_url = "#{post.created_at.strftime('%d-%m-%Y')}/post-#{post.id}"
- preload = true if @preoload_post && @preload_post == post.id
== link_to ' ', post_by_date_path(post.created_at.strftime('%d-%m-%Y'), post.id), :"data-hash" => post_url, :"data-track-name" => post.title, class: 'clickableTrack', remote: true
/* ======== SCHEMA =======
{
_id: "507f1f77bcf86cd799439011",
meta_information: {
general: {
@gabriel-dehan
gabriel-dehan / client - sign-up.html
Created February 1, 2015 19:30
Autoform for registration
<template name="signUpForm">
{{ #autoForm schema="Schemas.Form.Register" id="user-auth-form" type="method" meteormethod="user-auth:register" }}
<fieldset>
<legend>Create an account</legend>
{{> afQuickField name='username' }}
{{> afQuickField name='email' label='Email' }}
{{> afQuickField name='password' }}
{{> afQuickField name='passwordConfirmation' }}
</fieldset>
<input type="submit">
@gabriel-dehan
gabriel-dehan / meteor-modal.html
Last active August 29, 2015 14:15
Meteor modal helper
<template name="_RiseModal">
<div class="modal fade" id="{{ modalId }}">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
{{ #if canClose }}