Skip to content

Instantly share code, notes, and snippets.

View raul782's full-sized avatar

Raul Rodriguez raul782

View GitHub Profile
@raul782
raul782 / gist:2609901
Created May 6, 2012 03:48
Util File Core
<?php
class Utils_File_Core
{
protected $filename = "";
protected $path = "";
protected $fullfilename ="";
const NEWLINE = 0x0A;
const CARRIAGE = 0x0D;
@raul782
raul782 / counter-life-of-files.php
Created July 20, 2012 06:28
[Linux OSX] pretty fast command to Count lines of a file
<?php
$i = exec("wc -l file");
@raul782
raul782 / fancyQuery.js
Created July 20, 2012 18:19
Snippet fancybox js usage
jQuery(document).ready(function() {
$("#id").click(function() {
$.fancybox({
'padding' : 0,
'href' : 'http://www.domain.com/flash.swf',
'title' : '',
'transitionIn' : 'elastic',
'transitionOut' : 'elastic'
});
@raul782
raul782 / guzzle-404.php
Created October 29, 2012 18:29
guzzle 404
<?php require_once(__DIR__.'/../../vendor/autoload.php');
use Guzzle\Http\Client;
use Guzzle\Common\Event;
use Guzzle\Http\Message\Request;
use Guzzle\Http\Message\Response;
use Guzzle\Http\Exception\BadResponseException;
$url = 'http://www.amazon.com';
$client = new Client($url);
@raul782
raul782 / testMockbuilder.php
Created November 10, 2012 16:11
mockbuilder
$stub = $this->getMockBuilder('\PHPPeru\LazyController')
->setConstructorArgs(array($this->container))
->getMock();
$stub->expects($this->once())
->method('lightAction')
->will($this->returnValue('Hello world!'));
@raul782
raul782 / FrontCache.php
Created November 22, 2012 20:35
simple cache php
<?php
class FrontCache
{
private $page;
private $dir;
private $expirationTime;
public function __construct($page, $dir='cache', $expirationTime = 86400)
{
$this->page = $page;
.fc {
direction: ltr;
text-align: left; }
.fc table {
border-collapse: collapse;
border-spacing: 0; }
.fc .btn {
line-height: 1.2em; }
html .fc {
@raul782
raul782 / services.xml
Last active December 10, 2015 14:38
Services.xml example for Symfony2
<?xml version="1.0" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
<parameters>
<parameter key="order_distributorMailParser.class">Erp\Bundle\OrderBundle\Services\DistributorMailParser</parameter>
@raul782
raul782 / Sql2005SpanishPlatform.php
Last active December 10, 2015 22:38
Sql2005SpanishPlatform for Doctrine
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@raul782
raul782 / build.sbt
Created February 7, 2013 23:13
SBT template : 2.10 + slick
//
// Copyright 2013 Raul Rodriguez
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software