Skip to content

Instantly share code, notes, and snippets.

View nono's full-sized avatar

Bruno Michel nono

  • Cozy Cloud
  • Paris, France
View GitHub Profile
@nono
nono / Gemfile
Last active August 29, 2015 13:56
Error when paginating the results of a complex query with es-model
source 'https://rubygems.org'
gem "ansi"
gem "jbuilder"
gem "sqlite3"
gem "activerecord"
gem "kaminari"
gem "elasticsearch-model", :github => "elasticsearch/elasticsearch-rails"
@nono
nono / Profiling
Created March 28, 2014 10:12
Profiling a request, with a bottleneck on therubyracer
100.0% - …/bin/unicorn#<main>
167 Collapsed methods (show)
100.0% - …/action_view/template.rb#block in render
97.0% - …/complete_creations/_single_address.html.haml#_app_views_orders_wizard_complete_creations__single_address_html_haml__386521348274838379_97485080
20 Collapsed methods (show)
97.0% - …/complete_creations/_single_address.html.haml#block in _app_views_orders_wizard_complete_creations__single_address_html_haml__386521348274838379_97485080
85.0% - …/complete_creations/_single_address.html.haml#each_with_index
21 Collapsed methods (show)
85.0% - …/ordering/complete_creations.rb#option_price_structure
83.0% - …/ordering/complete_creations.rb#option_base_price_with_sale_applied
@nono
nono / analysis.yaml
Last active August 29, 2015 14:08
I can't understand why Elasticsearch can't find Europe with a snowball analyzer...
text:
- "Western Europe antiquities"
- "Antiquités de l'Europe occidentale"
analyzer:
snowball_en:
type: snowball
language: English
snowball_fr:
type: custom
@nono
nono / _gem
Created August 23, 2009 19:10 — forked from tomafro/_gem
#compdef gem
# My first zsh completion function, for the gem command. It lets you type 'gem <tab>' to complete gem commands
# (including installed ones) and for some commands (currently just open and update) allows you to complete gem
# names as well. The implementation isn't ideal, so I'd appreciate advice on how I can improve it, particularly
# the 'caching' of the gem_commands and installed_gems.
local curcontext="$curcontext" state line ret=1
_arguments -C \
#!/usr/bin/env ruby
# Author: Bruno Michel <bruno.michel@af83.com>
# Copyright 2010 (c) af83
# Licence: MIT http://www.opensource.org/licenses/mit-license.php
# Add two comments to each of your Rails view with the name of this file,
# one at the beginning and the other at the end.
TMPL_BEGIN = "<!-- Start of %s -->\n"
TMPL_END = "<!-- End of %s -->\n"
#!/usr/bin/env ruby
# Author: Bruno Michel <bruno.michel@af83.com>
# Copyright 2010 (c) af83
# Licence: MIT http://www.opensource.org/licenses/mit-license.php
# Parse the given log files and extract the list of URL
if ARGV.empty?
puts "Usage: #{$0} <logfiles>"
exit 1
Username = <%= @var %>
@nono
nono / maze.rb
Created April 13, 2011 21:02
bin/maze.rb
#!/usr/bin/env ruby
require "maze"
i = 1
e = nil
loop do
maze = Maze.new(i, e)
maze.fetch
maze.construct
@nono
nono / Makefile
Created June 22, 2011 09:48
Long polling with golang... only 282 clients?
include $(GOROOT)/src/Make.inc
TARG=long_polling
GOFILES=long_polling.go
include $(GOROOT)/src/Make.cmd
@nono
nono / Makefile
Created June 27, 2011 10:53
Stressing my long-polling server
include $(GOROOT)/src/Make.inc
TARG=go-bench
GOFILES=go-bench.go
include $(GOROOT)/src/Make.cmd