Skip to content

Instantly share code, notes, and snippets.

View loalf's full-sized avatar

Javier Lopez loalf

  • iTech Media
  • Córdoba, Spain
View GitHub Profile
@loalf
loalf / TweetSet.scala
Created October 11, 2013 12:13
Week3 assigment
package objsets
import common._
import TweetReader._
/**
* A class to represent tweets.
*/
class Tweet(val user: String, val text: String, val retweets: Int) {
override def toString: String = text + "[" + retweets + "]"
@loalf
loalf / FunSets.scala
Created October 1, 2013 07:27
Solution to the second week
package funsets
import common._
/**
* 2. Purely Functional Sets.
*/
object FunSets {
/**
@loalf
loalf / reviews.php
Created June 27, 2013 10:35
Small script to show reviews in a page
<html>
<head>
<script type="text/javascript" src="http://timeout.pluck.com/ver1.0/Content/ua/scripts/pluckApps.js"></script>
<link rel="stylesheet" type="text/css" href="http://timeout.pluck.com/ver1.0/Content/ua/css/pluckAll.css" />
<script type="text/javascript">
pluckAppProxy.embedApp("pluck_login_withFacebook", {
plckLogoutUrl: "/Security/Logout"
}, {});
</script>
</head>
@loalf
loalf / gist:4169549
Created November 29, 2012 14:49
Validacion en el componente Config
/**
* Configuracion en archivo config.yml
*
* mi_bundle:
* config_file: "path/to/file.ini"
*
*/
class Configuration implements ConfigurationInterface
{
@loalf
loalf / Form.class.php
Created November 26, 2012 11:57
Security patch
<?php
class IPC_Form extends sfForm {
/**
* Binds the form with input values.
*
* It triggers the validator schema validation.
*
* @param array $taintedValues An array of input values
@loalf
loalf / config.yml
Created August 25, 2012 21:35
config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
framework:
#esi: ~
#translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
Doctrine_Query::create()
->select('m.*, t.field as translated_field')
->from('Model m')
->leftJoin('m.Translation t)
->where('t.field = ?', $value)
@loalf
loalf / precios_response.xml
Created June 22, 2011 11:34
Contratación póliza
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
<getPreciosResponse xmlns="http://xml.innovac.es">
<getPreciosResult>
<resultado xmlns="">
<PRECIO>
<NumPoliza>550441944</NumPoliza>
<Franja>2</Franja>
<TotalEspanya>1.05</TotalEspanya>
<TotalAndorra>1.05</TotalAndorra>