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
#!/bin/sh | |
# Redirect output to stderr. | |
exec 1>&2 | |
# enable user input | |
exec < /dev/tty | |
consoleregexp='console.log|debugger|binding.pry' | |
# CHECK | |
if test $(git diff --cached | grep -E $consoleregexp | wc -l) != 0 | |
then |
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
// Show matched results. First beggining results with match string and then the rest of them. | |
// Using Jquery autocomplete and Lodash library | |
// items is array of objects where label is the text to show in the input. | |
$('.autocomple').autocomplete({ | |
source: function(request, response) { | |
var matcher = new RegExp( $.ui.autocomplete.escapeRegex( request.term ), "i" ); | |
var results = _.filter(items, function(item) { | |
return matcher.test(item.label); | |
}); |
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
# con el codigo_id de las provincias https://gist.github.com/Lycisca/7dba9fd4f1e5e9d26f5f | |
Poblacion.create!([ | |
{ provincia_id: 1, nombre: "Alegría-Dulantzi" }, | |
{ provincia_id: 1, nombre: "Amurrio" }, | |
{ provincia_id: 1, nombre: "Añana" }, | |
{ provincia_id: 1, nombre: "Aramaio" }, | |
{ provincia_id: 1, nombre: "Armiñón" }, | |
{ provincia_id: 1, nombre: "Arraia-Maeztu" }, | |
{ provincia_id: 1, nombre: "Arratzua-Ubarrundia" }, |
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
# Mismos códigos que el INE para poder relacionarlo con las poblaciones | |
Provincia.create!([ | |
{ id: 2, nombre: 'Albacete' }, | |
{ id: 3, nombre: 'Alicante/Alacant' }, | |
{ id: 4, nombre: 'Almería' }, | |
{ id: 1, nombre: 'Araba/Álava' }, | |
{ id: 33, nombre: 'Asturias' }, | |
{ id: 5, nombre: 'Ávila' }, | |
{ id: 6, nombre: 'Badajoz' }, |
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
Pais.create!([ | |
{nombre: "Austria"}, | |
{nombre: "Afganistán"}, | |
{nombre: "Albania"}, | |
{nombre: "Alemania"}, | |
{nombre: "Andorra"}, | |
{nombre: "Angola"}, | |
{nombre: "Antigua y Barbuda"}, | |
{nombre: "Arabia Saudí"}, | |
{nombre: "Argelia"}, |
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
# Países según el INE a 1 de enero de 2015 | |
insert into {database_name}.{table_name} ({field}) | |
values ('Austria'),('Afganistán'),('Albania'),('Alemania'),('Andorra'),('Angola'),('Antigua y Barbuda'),('Arabia Saudí'),('Argelia'),('Argentina'),('Armenia'),('Australia'),('Azerbaiyán'),('Bahamas'),('Bahréin'),('Bangladesh'),('Barbados'),('Belarús'),('Bélgica'),('Belice'),('Benin'),('Bhután'),('Bolivia'),('Bosnia y Herzegovina'),('Botswana'),('Brasil'),('Brunei'),('Bulgaria'),('Burkina Faso'),('Burundi'),('Cabo Verde'),('Camboya'),('Camerún'),('Canadá'),('Chad'),('Chile'),('China'),('Chipre'),('Colombia'),('Comores'),('Congo'),('Corea'),('Corea del Norte'),('Costa de Marfil'),('Costa Rica'),('Croacia'),('Cuba'),('Dinamarca'),('Djibouti'),('Dominica'),('Ecuador'),('Egipto'),('El Salvador'),('Emiratos Árabes Unidos'),('Eritrea'),('Eslovenia'),('España'),('Estados Unidos de América'),('Estonia'),('Etiopía'),('Fiji'),('Filipinas'),('Finlandia'),('Francia'),('Gabón'),('Gambia'),('Georgia'),('Ghana'),('Granada'),('Greci |
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
%w[Andalucía Aragón Canarias Cantabria Castilla\ y\ León Castilla\ La\ Mancha Cataluña Ceuta Comunidad\ Valenciana Comunidad\ de\ Madrid Extremadura Galicia Islas\ Baleares La\ Rioja Melilla Navarra País\ Vasco Principado\ de\ Asturias Región\ de\ Murcia] |