Skip to content

Instantly share code, notes, and snippets.

@nmelox
nmelox / gist:726480
Created December 3, 2010 02:19
example dog
<html>
<body>
<script>
function Dog (name){
this.bark = function (){
var dogprop = {
type: 'Animal'
}
alert (name+': Guaw!! I am a '+dogprop.type);
}
@nmelox
nmelox / gist:726546
Created December 3, 2010 03:28
mismo ejercicio optimizado.(menos codigo)
<html>
<body>
<script>
var dog ={
name: '',
bark: function(name){
alert (dog.name+': Guaw!!');
}
}
var d = dog;
@nmelox
nmelox / gist:726548
Created December 3, 2010 03:28
mismo ejercicio optimizado.(menos codigo)
<html>
<body>
<script>
var dog ={
name: '',
bark: function(name){
alert (dog.name+': Guaw!!');
}
}
var d = dog;
@nmelox
nmelox / gist:959480
Created May 6, 2011 18:21
primer proyect ruby
#!/usr/bin/env ruby
class MegaAnfitrion
attr_accessor :nombres
# Crear el objeto
def initialize(nombres = "Mundo")
@nombres = nombres
end
@nmelox
nmelox / gist:959483
Created May 6, 2011 18:22
primer proyect ruby NM
#!/usr/bin/env ruby
Class Perro
attr_accessor :nombre
attr_accessor :edad
def initialize(nombre="Mundo",edad="0")
@nombre=nombre
@edad=edad
end
@nmelox
nmelox / erro msg
Created June 15, 2011 01:22
Error message
C:/Ruby192/lib/ruby/1.9.1/net/http.rb:678:in `connect': SSL_connect returned=1 errno=0
state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:678:in `block in connect'
from C:/Ruby192/lib/ruby/1.9.1/timeout.rb:44:in `timeout'
from C:/Ruby192/lib/ruby/1.9.1/timeout.rb:87:in `timeout'
from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:678:in `connect'
from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:637:in `do_start'
from C:/Ruby192/lib/ruby/1.9.1/net/http.rb:626:in `start'
from C:/Ruby192/lib/ruby/1.9.1/open-uri.rb:306:in `open_http'
from C:/Ruby192/lib/ruby/1.9.1/open-uri.rb:769:in `buffer_open'
@nmelox
nmelox / unomas
Created September 30, 2011 22:19
project de javascript
<html>
<body>
<script type="text/javascript">
alert("Hello World!")
document.writeln(new Date()+"<br>")
var _sum1 = 40
var _sum2 = 30
var res = _sum1 + _sum2
document.write(res)
@nmelox
nmelox / Auto.class
Created October 22, 2011 18:34
Jva-Clase2/3_Persona-Auto-Vehiculo
public class Auto {
private String Patente;
private static int cantidadDeAutos;
public Auto (String patente){
this.Patente = patente;
cantidadDeAutos ++;
}
public static int getcantidad(){
return cantidadDeAutos;
}
@nmelox
nmelox / valorAuto.js
Created October 26, 2011 02:17
segundo_javascript
function valorAuto (valor,modelo,año){
if (typeof(valor) != "number" || valor < 0) {
console.error ("Ingrese un numero como primer parametro");
return;
}
if (typeof(modelo) != "string" || modelo.lenght <= 0) {
console.error ("Ingrese un texto como segundo parametro");
return;
}
if (typeof(año) != "number" || valor < 0) {
@nmelox
nmelox / Analisis.java
Created November 10, 2011 15:37
Sistema Laboratorio
public class Analisis {
private String Descripcion;
private int Precio;
/**
* @return the Descripcion
*/
public String getDescripcion() {
return Descripcion;
}