This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#encoding: utf-8 | |
require 'tire' | |
require 'json' | |
require 'active_support/core_ext/object/to_query' | |
require 'active_support/core_ext/object/to_param' | |
conf = { | |
settings: { | |
number_of_shards: 1, | |
number_of_replicas: 0, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mix_periods | |
list_period = seasons.inject([]) do |acc, season| | |
season.periods.inject(acc) do |a,period| | |
a << (period.start_date..period.end_date); a | |
end | |
end | |
until list_period.empty? | |
period_test = list_period.pop | |
if list_period.any?{|lp| period_test.cover?(lp.begin) || lp.cover?(period_test.begin) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"flag" | |
"github.com/bmizerany/pat" | |
"io" | |
"log" | |
"net/http" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def long_filename | |
sha1 = File.read('sha1').chomp | |
"my_prog-#{sha1}" | |
end | |
file "archive.tgz" do | |
Rake::Task[:build].invoke | |
`tar cvzf archive.tgz #{long_filename}` | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "openssl" | |
class BF < Struct.new(:key, :pad_with_spaces) | |
def encrypt(str) | |
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt | |
if pad_with_spaces | |
str += " " until str.bytesize % 8 == 0 | |
cipher.padding = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
proj "github.com/pebbe/go-proj-4/proj" | |
) | |
const ( | |
// Epsg = "+init=epsg:27572" | |
Epsg = "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +pm=paris +units=m +no_defs no_defs <>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'https://rubygems.org' | |
gem "ansi" | |
gem "jbuilder" | |
gem "sqlite3" | |
gem "activerecord" | |
gem "kaminari" | |
gem "elasticsearch-model", :github => "elasticsearch/elasticsearch-rails" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"took" : 3, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 1, | |
"successful" : 1, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 2, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
text: | |
- "Western Europe antiquities" | |
- "Antiquités de l'Europe occidentale" | |
analyzer: | |
snowball_en: | |
type: snowball | |
language: English | |
snowball_fr: | |
type: custom |