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
<%= form_tag do %> | |
<!-- <label for="nombre">Nombre:</label> --> | |
<%= label_tag(:nombre, "Nombre:") %> | |
<!-- <input id="nombre" name="nombre" type="text"> --> | |
<%= text_field_tag(:nombre) %> | |
<br /> | |
<%= label_tag(:descripcion, "Descripcion General") %> |
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
console.log('Hola Profesor Xavier'); |
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 contructor Function() | |
var lanzaLlamas = new Function( | |
'console.log("Vamos charmandar, usa lanzallamas")' | |
); | |
// Declaración de funciones | |
function ascuas() { | |
console.log("Charmandar, ascuas"); | |
} |
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
require 'nokogiri' | |
require 'open-uri' | |
page = Nokogiri::HTML(open('http://www.mef.gob.pe/contenidos/tipo_cambio/tipo_cambio.php')) | |
page.css("select[name='nuevo_ano'] option").each do |option| | |
puts option.content | |
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
ActiveSupport::Inflector.inflections.clear | |
ActiveSupport::Inflector.inflections do |inflect| | |
inflect.plural /([rlnd])([A-Z]|_|$)/, '\1es\2' | |
inflect.plural /([aeiou])([A-Z]|_|$)/, '\1s\2' | |
inflect.singular /([aeiou])s([A-Z]|_|$)/, '\1\2' | |
inflect.singular /([rlnd])es([A-Z]|_|$)/, '\1\2' | |
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
db.users.insert({ | |
name: "Susana", | |
address: "Calle Lima 257", | |
age: 25, | |
status: "A" | |
}); |
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
var doc1 = { | |
name: "Julián", | |
age: 16, | |
address: "Calle Bolivar 209", | |
status: "D" | |
} | |
var doc2 = { | |
name: "Fatima", | |
age: 28, | |
address: "Calle Bolivar 302", |
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
db.users.update( | |
{ age: { $gt: 18 } }, | |
{ $set: { status: "A" } }, | |
{ multi: true } | |
); |
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
db.users.find( | |
{ age: { $gt: 18 } }, | |
{ name: 1, address: 1 } | |
).limit(5); |
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
db.users.remove( | |
{ status: "D" } | |
); |
OlderNewer