Skip to content

Instantly share code, notes, and snippets.

View Osukaru's full-sized avatar

Osukaru Osukaru

View GitHub Profile
@Osukaru
Osukaru / gist:bba1feea15a4d4b0f228
Last active August 29, 2015 14:25
Password Value Object
<?php
class User
{
protected $username;
protected $password;
public function __construct($username, Password $password)
{
$this->username = $username;
@Osukaru
Osukaru / counter.php
Created July 26, 2013 10:09
Dragon simulator
<?php
$allFollowingPieces = array(
'a' => array('b', 'E'),
'b' => array('c', 'D'),
'c' => array('d', 'C'),
'd' => array('e', 'B'),
'e' => array('a', 'A'),
'A' => array('B', 'e'),
'B' => array('C', 'd'),
@Osukaru
Osukaru / robot.js
Created December 6, 2012 10:14
Osukaru
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
//En FIC_Backend_Model_Episode
public function getMissingSlugEpisodes()
{
$episodes = array();
$select = $this->select(true)
->where("episode_slug = ''");
$episodes = $select->query()->fetchAll();
return $episodes;
public function fetchByCountryBrand($countryBrandId, $providerName = 'mpx')
{
$select = $this->select(true)
->join('album', 'album_id = video_album_id', array())
->join('serie', 'serie_id = album_serie_id', array())
->where('video_status = 1')
->where('video_provider_name = ?', $providerName)
->where('video_uploaded = 0')
->where('video_brand_id = ?', $countryBrandId);
@Osukaru
Osukaru / email_valido.sql
Created October 11, 2011 13:01
Refactoring
--Ahora:
CREATE OR REPLACE FUNCTION AEGPA_EP."EMAIL_VALIDO" (parametro IN OUT VARCHAR2)
RETURN BOOLEAN
IS
BEGIN
RETURN REGEXP_LIKE(parametro, '[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+\.[a-zA-Z]{2,4}');
END email_valido;
/
@Osukaru
Osukaru / ejemplos.sql
Created October 7, 2011 08:47
tipos de datos
**********
Ejemplo de tipos de datos
**********
CREATE OR REPLACE TYPE pk_licencia AS OBJECT
(
cod_tipo_licencia VARCHAR2(10)
, num_licencia VARCHAR2(8)
, CONSTRUCTOR FUNCTION pk_licencia(licencia VARCHAR2) RETURN SELF AS RESULT
)
INSTANTIABLE FINAL;
@Osukaru
Osukaru / MainMenu.php
Created October 2, 2011 10:38
Extender MenuBundle
<?php
namespace SFM\WebsiteBundle\Menu;
use Knp\Bundle\MenuBundle\Menu;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Router;
class MainMenu extends Menu
{
@Osukaru
Osukaru / firma.xml
Created September 28, 2011 14:18
Respuesta de la plataforma de firma
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><verifySignatureSResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><verifySignatureSReturn href="#id0"/></verifySignatureSResponse><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:ResultVerifyInfoSet" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:jfactory"><arrayList href="#id1"/><resultInfo href="#id2"/></multiRef><multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"><multiRef href="#id3"/></multiRef><multiRef id="id2" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:t
@Osukaru
Osukaru / PARAM_APLICACION.sql
Created September 23, 2011 10:56
Paquete que lleva la parametrización de la aplicación
CREATE OR REPLACE PACKAGE PSPGEN.PARAM_APLICACION
AS
FUNCTION WEB_URL_BASE RETURN VARCHAR2;
FUNCTION WEB_DEFAULT_PAGE RETURN VARCHAR2;
FUNCTION URL_ACCESO RETURN VARCHAR2;
FUNCTION DATABASE_OWNER RETURN VARCHAR2;
FUNCTION APP_NAME RETURN VARCHAR2;
FUNCTION LINK_APP RETURN VARCHAR2;
FUNCTION LINK_APP_EMAIL RETURN VARCHAR2;
FUNCTION REPORT_WEBSERVICE_URL RETURN VARCHAR2;