{{ message }}

Instantly share code, notes, and snippets.

# Iwan Buetti iwan

• Milano, Italy
Created Feb 18, 2019
Cinque province italiane (senza id)
View cinque_province_senza_id.geojson
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active Feb 18, 2019
Cinque province italiane (con id)
View cinque_province.geojson
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Last active Feb 18, 2019 — forked from datajournalism-it/province.geojson
Confini amministrativi delle province italiane
View province.geojson
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Created Jul 9, 2018
Primality test in Elixir - a simple method
View prime.ex
 defmodule Prime do # https://en.wikipedia.org/wiki/Primality_test#Simple_methods def is_prime(0) do false end def is_prime(1) do false end
Created May 25, 2018
View excel_columns_convertions.rb
 module ExcelColumnsConverions # convert the column name ("A", "ACB", ...) to an number (1-based) def excel_col_number(str) offset = 'A'.ord - 1 str.chars.inject(0){ |x,c| x*26 + c.ord - offset }.to_i end # convert the column number to a string ("A", "ACB", ...) def excel_col_string(number)
Created May 23, 2018
Random string generator
View rand_string_generator.rb
 def random_string(length=16) source = ("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a Array.new(length){|e| source[rand(source.size)]}.join end
Created Apr 4, 2018 — forked from hmans/elixir_phoenix_notes.md
Notes on learning Elixir and Phoenix
View elixir_phoenix_notes.md

# Notes on learning Elixir and Phoenix

Just some assorted notes I've made while digging into Phoenix, Elixir and friends. I'm coming from a strong Rails background, so many of these will refer to features from that framework.

## Views / Templates

#### Biggest difference from Rails?

Unlike Rails, where rendering is almost always performed by a template file, the responsibility of rendering a response in Phoenix lies with a view module (that typically corresponds to the current controller module.) This view module will typically offer a whole bunch of `render` functions (matching different parameters, first and foremost the template name.) Templates (found in `web/templates/`) will directly compile into such functions.

Created Jan 26, 2018
Script to merge multiple similar .xls file into one
View mergia.rb