Skip to content

Instantly share code, notes, and snippets.

Manuel Matías Zubieta manuel14

View GitHub Profile
View getTeam
//esto es en android en la welcomeActivity
String userId = currentUser.getObjectId();
final HashMap<String, Object> params = new HashMap<>();
params.put("id", userId);
ParseCloud.callFunctionInBackground("getTeam", params, new FunctionCallback<ParseObject>() {
public void done(ParseObject o, ParseException e) {
if (e == null) {
Toast.makeText(getApplicationContext(),
View transporteconverter
/*
* 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;
View transporteconverter
/*
* 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;
View vista y js y html
(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))
View comprobar y funcion js
@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))
@manuel14
manuel14 / gist:7455806
Created Nov 13, 2013
cirujator.java corregido
View gist:7455806
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;
View gist:7455244
// $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;
View gist:7455068
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;
View gist:6589159
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))
View gist:6565013
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
You can’t perform that action at this time.