Skip to content

Instantly share code, notes, and snippets.

View Sephi-Chan's full-sized avatar

Romain Tribes Sephi-Chan

  • Nîmes, France
View GitHub Profile
<div class="exercise">
<p class="instruction"><span class="counter"></span>Recopie chaque liste en rangeant les mots dans l'ordre alphabétique.</p>
<ul>
<li>
<ul class="inline">
<li>pastille</li>
<li>cercle</li>
<li>lavande</li>
<li>force</li>

Plans

    • Grande chambre principale avec salle d'eau et rangements.
    • Chambres secondaires (pour une chambre et un bureau).
    • Garage petit (uniquement pour du stationnement dans sa taille actuelle), pourquoi le faire dépasser ?
  • ? Où sont les systèmes (chauffe-eau, etc.) ?
  • ? Que représente la croix au dos des toilettes ?
# Accepts a data structure such as:
# [ [ 28 ], [ 29, 30 ], [ 80 ], [ 6 ] ]
class Board < Struct.new(:matrix)
Response = Struct.new(:load)
# Finds the column (1-indexed) with the nearest predecessor of the given value.
# Returns nil if there is no such predecessor.
def column_for(given_value)
last_values = matrix.map(&:last)
@Sephi-Chan
Sephi-Chan / convoy_spec.rb
Created January 13, 2015 17:52
Struct prototyping
require 'spec_helper'
RSpec.describe Convoy do
it 'has wayponts' do
Convoyy = Struct.new(:waypoints) do
def replace_waypoint(old_waypoint_step_number, new_waypoints)
waypoints
.select { |waypoint| old_waypoint_step_number <= waypoint.step_number }
.map { |waypoint| waypoint.active = false }
#!/usr/bin/env ruby
require File.expand_path('../../config/environment', __FILE__)
require 'thor'
class PlayersCommand < Thor
desc :add, 'Add a player with the given name.'
method_option :force, desc: 'Delete the player if it already exists.', type: :boolean, default: false
def add(name)
existing_player = Player.find_by_name(name)
➜ Seelies git:(master) cloc app/models --by-file
37 text files.
37 unique files.
0 files ignored.
http://cloc.sourceforge.net v 1.60 T=0.09 s (428.2 files/s, 6597.3 lines/s)
--------------------------------------------------------------------------------------------
File blank comment code
--------------------------------------------------------------------------------------------
app/models/dispatcher.rb 15 3 49
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
path = '/Users/romaintribes/Seelies'
# RabbitMQ, Web app and models
run "cd #{path}/web_app"
run 'rabbitmq-server -detached'
run 'sleep 1'
run 'subl .'
run 'sleep 1'
run 'rails server --port 3100'
@Sephi-Chan
Sephi-Chan / 10_presence_server.erl
Last active December 15, 2015 19:29
Chat server with Erlang.
-module(presence_server).
-behaviour(gen_server).
-export([ start_link/0 ]).
-export([ player_is_online/1, player_is_offline/1, online_players/0 ]).
-export([ init/1, handle_cast/2, handle_call/3, terminate/2, handle_info/2, code_change/3 ]).
start_link() ->
gen_server:start_link({ local, ?MODULE }, ?MODULE, [], []).
-module(seelies_server_websocket_handler).
-behaviour(cowboy_websocket_handler).
-export([ init/3, websocket_init/3, websocket_handle/3, websocket_info/3, websocket_terminate/3 ]).
-record(connection, { id, name = none }).
-include("../include/constants.hrl").
init({ tcp, http }, _Request, _Options) ->
{ upgrade, protocol, cowboy_websocket }.