Skip to content

Instantly share code, notes, and snippets.

View rudisimo's full-sized avatar
🔕

Rudy Puig rudisimo

🔕
View GitHub Profile
<?php
public function search(array $search = NULL, $sort = null, $order = "ASC", $limit = 10) {
$params = array();
$values = array();
// create query builder
$ns = 's';
$qb = $this->createQueryBuilder($ns);
// build parameter bag
if ($search) {
(function() {
var avId = 'DfpVisibilityIdentifier_' + Math.floor(Math.random() * 1e16);
document.write('\x3cdiv class="GoogleActiveViewClass" ' + 'id="' + avId + '" ' + 'data-admeta-dfp="2620/nbcu.telemundo/home,728,90,17653192060730791213,0.02"\x3e');
document.write('\x3cdiv class\x3d\x22GoogleActiveViewClass\x22 id\x3d\x22DfaVisibilityIdentifier_777495656317326339\x22\x3e\x3c!-- Copyright 2014 DoubleClick, a division of Google Inc. All rights reserved. --\x3e\n\x3c!-- Code auto-generated on Tue Feb 11 12:42:56 PST 2014 --\x3e\n\x3cscript src\x3d\x22http://s0.2mdn.net/879366/flashwrite_1_2.js\x22\x3e\x3c/script\x3e\n\x3cSCRIPT LANGUAGE\x3d\x22JavaScript\x22\x3e\n\x3c!--\nfunction DCFlash(id,pVM){\nvar swf \x3d \x22http://s0.2mdn.net/3787378/KMC_Hspnc_728x90_v2.swf\x22;\nvar gif \x3d \x22http://s0.2mdn.net/3787378/KMC_Hspnc_728x90.jpg\x22;\nvar minV \x3d 9;\nvar FWH \x3d \x27 width\x3d\x22728\x22 height\x3d\x2290\x22 \x27;\nvar url \x3d escape(\x22http://adclick.g.doubleclick.net/aclk?sa\x3dL\x26a
@rudisimo
rudisimo / Rakefile
Last active August 29, 2015 13:56
Developer Rakefile for Telemundo's Pub7
env_drush = ENV.key?("DRUSH") ? ENV["DRUSH"] : "drush"
env_id = ENV.key?("ENV") ? ENV["ENV"] : "nbcutelemundo.local"
env_profile = ENV.key?("PROFILE") ? ENV["PROFILE"] : "publisher"
env_db_url = ENV.key?("DB_URL") ? ENV["DB_URL"] : "mysql://root@localhost/publisher7_nbcutelemundo"
env_admin_user = ENV.key?("ADMIN_USER") ? ENV["ADMIN_USER"] : "admin"
env_admin_pass = ENV.key?("ADMIN_PASSWORD") ? ENV["ADMIN_PASSWORD"] : "Pa55word"
env_admin_email = ENV.key?("ADMIN_EMAIL") ? ENV["ADMIN_EMAIL"] : "admin@telemundo.com"
params_default = ["-y"]
params_install = [
@rudisimo
rudisimo / ubuntu-php-downgrade.sh
Last active August 29, 2015 14:01
PHP 5.2 Downgrade Script
#!/bin/sh
# Script to install PHP 5.2 from 9.10 on 10.04
# And pin it so it does not get updated
for PKG in `dpkg -l | grep php | awk '{print $2}'`
do
echo "$PKG hold" | dpkg --set-selections
done
<?php
namespace Veo\Model\Service {
use \PHPUnit_Framework_TestCase;
use Veo\Model\Service\searchService;
.
.
.

Keybase proof

I hereby claim:

  • I am rudisimo on github.
  • I am rudisimo (https://keybase.io/rudisimo) on keybase.
  • I have a public key whose fingerprint is 609A 3B65 6697 DC4D 4BDD 6466 5B36 4035 0B63 E69F

To claim this, I am signing this object:

function #calls time memory time memory
------------------------------------------------------------------------------------------------------------------------------------------------------
debug_backtrace 2181 0.1882 91947528 0.1882 91947528
Composer\Autoload\includeFile 470 2.5852 16479216 1.7203 12574904
Doctrine\ORM\Mapping\ClassMetadataInfo->isCollectionValuedAssociation 165326 4.5283 8320488 4.5283 8320488
Doctrine\ORM\Mapping\ClassMetadataInfo->isIdentifier 165352 4.5911 8319552 4.5911 8319552
str_replace 11290
@rudisimo
rudisimo / gist:5169574
Created March 15, 2013 12:31
Cortex README.md

Cortex

Core JavaScript library for Telemundo.com.

How to build your own Cortex

First, clone a copy of the main Cortex git repo by running:

@rudisimo
rudisimo / url.php
Last active December 18, 2015 22:29
PHP learning session.
<?php
/**
* Data tokenizer interface.
*/
interface Tokenized {
function hash();
function tokenize();
}
@rudisimo
rudisimo / gist:5864637
Created June 26, 2013 03:52
Ubuntu history
cd ~; curl -#L https://github.com/rudisimo/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,LICENSE-MIT.txt,bootstrap.sh};
vim .profile
curl -Lo- https://bit.ly/janus-bootstrap | bash
sudo apt-get install git
curl -Lo- https://bit.ly/janus-bootstrap | bash
sudo apt-get install ruby
sudo apt-get search gem
sudo apt-cache search gem
sudo apt-cache search gem | grep gem
sudo apt-cache search gem | grep " gem"