Skip to content

Instantly share code, notes, and snippets.

View manuel14's full-sized avatar

Manuel Matías Zubieta manuel14

  • cordoba, argentina
View GitHub Profile
@manuel14
manuel14 / gist:6252822
Created August 16, 2013 19:32
template
<html>
<style
img { width:100px; }
</style>
<header>
<nav>
<ul>
<li><a href="/">Inicio</a></li>
<li><a href="/usuarios">Usuarios registrados</a></li>
<li><a href="/recetas">Recetas</a></li>
@manuel14
manuel14 / gist:6565013
Created September 14, 2013 19:47
ladero
class Noticia(models.Model):
titulo = models.TextField()
texto = models.TextField(help_text='Redacta la Noticia')
autor = models.TextField(verbose_name='Autor')
#imagen = models.ImageField(upload_to='rrpp', verbose_name='imagen')
#tiempo_registro = models.DateTimeField(auto_now=True)
usuario = models.ForeignKey(User)
def __unicode__(self):
return self.titulo
def guardar_noticia(request):
if request.method=='POST':
titulo = request.POST['titulo']
autor = request.POST['autor']
texto = request.POST['texto']
usuario = request.POST['usuario']
if usuario.isdigit():
return HttpResponseRedirect('/')
else:
noticia = Noticia(titulo=titulo, autor=autor, texto=texto, usuario=User(usuario))
@manuel14
manuel14 / gist:7455068
Created November 13, 2013 19:41
cirujator.java
package w3bex;
import robocode.*;
import robocode.util.Utils;
import java.awt.geom.*;
public class cirujator extends AdvancedRobot {
// movimientos al azar, constantes y variables
static final double Maxima_Velocidad = 8;
static final double Margen_Pared = 25;
@manuel14
manuel14 / gist:7455244
Created November 13, 2013 19:51
lightning storm
// $Id: RandomMovementBot.java,v 1.2 2004/01/04 18:52:08 peter Exp $
package EH.kms;
import robocode.*;
import robocode.util.Utils;
import java.awt.geom.*;
public class LightningStorm extends AdvancedRobot {
// random movement constants and variables
// Credit goes to PEZ for RandomMovementBot
static final double MAX_VELOCITY = 8;
@manuel14
manuel14 / gist:7455806
Created November 13, 2013 20:28
cirujator.java corregido
package w3bex;
import robocode.*;
import robocode.util.Utils;
import java.awt.geom.*;
public class cirujator extends AdvancedRobot {
// movimientos al azar, constantes y variables
static final double Maxima_Velocidad = 8;
static final double Margen_Pared = 25;
@csrf_exempt
def comprobar(request):
usuario = request.POST["user"]
password = request.POST["pass"]
user = authenticate(username=usuario, password= password)
if user is not None:
return HttpResponse(simplejson.dumps(True))
else:
return HttpResponse(simplejson.dumps(False))
(vista)
def comprobar(request):
usuario = request.POST["user"]
password = request.POST["pass"]
user = authenticate(username=usuario, password= password)
if user is not None:
return HttpResponse(simplejson.dumps(True), context_instance=RequestContext(request))
else:
return HttpResponse(simplejson.dumps(False), context_instance=RequestContext(request))
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Converters;
import dacs.dao.TransporteFacade;
import dacs.models.Transporte;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Converters;
import dacs.dao.TransporteFacade;
import dacs.models.Transporte;