Skip to content

Instantly share code, notes, and snippets.

View favrik's full-sized avatar
🏀

Favio Manriquez favrik

🏀
View GitHub Profile
[2012-09-17 14:16:24] request.ERROR: Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "POST http://secure.c.com/cookieSetter.php" (uncaught exception) at /www/dev/sites/www.c.com/chess/Application/ChessBundle/Event/RouterListener.php line 23 [] {"file":"/www/dev/sites/www.c.com/chess/Application/ChessMonologBundle/Logger.php","line":52,"class":"Application\ChessMonologBundle\Logger","function":"addRecord","requestGetVariables":[],"requestPostVariables":{"banned":"undefined","optionalParam":"undefined"},"sessionData":[],"url":"/cookieSetter.php","ip":"127.0.0.1","http_method":"POST","server":"secure.c.com","referrer":"https://secure.c.com/checkUser.swf"}
@favrik
favrik / Vagrantfile
Created September 16, 2012 07:06
Chess.com Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
config.vm.box = "chessdev"
config.vm.guest = :freebsd
config.vm.box_url = "http://images.chesscomfiles-4.com/images/package.box"
config.vm.network :hostonly, "10.10.10.10"
@favrik
favrik / index_all.sh
Created September 7, 2012 02:00
Run the indexer on your local for Sphinxsearch
#!/bin/sh
cd /home/username/sphinx/
searchd --config sphinx.conf --stop
sleep 3;
indexer --config sphinx.conf users
indexer --config sphinx.conf users_by_username
@favrik
favrik / sphinx.conf
Created September 7, 2012 01:53
sphinx.conf
#############################################################################
## data source definition
#############################################################################
source users
{
type = mysql
sql_host = localhost
sql_user = root
sql_pass = k
IncludeFromPathList(PAYPAL_PATH, 'ppsdk_include_path.inc');
$strPath = GetValidPathFromList(PAYPAL_PATH);
if ($strPath !== false) {
set_include_path($strPath . PATH_SEPARATOR . get_include_path());
}
/**
* $strPathList is in the form of an include_paht: .:/usr/local/lib:etc
*/
function GetValidPathFromList($strPathList) {
$arrPaths = explode(PATH_SEPARATOR, $strPathList);
foreach ($arrPaths as $strPath) {
if (file_exists($strPath)) {
return $strPath;
}
<?php
$router = Container::get('router');
foreach ($router->getRouteCollection()->all() as $objRoute) {
$arrDefaults = $objRoute->getDefaults();
if ($arrDefaults['_controller'] == 'frontend/article/list') {
var_dump($objRoute);
break;
}
}
@favrik
favrik / gist:3405662
Created August 20, 2012 16:40
Primera version del script para la migracion a drupal de leonarte.com
<?php
abstract class BaseMigration extends Migration {
public function __construct() {
// Always call the parent constructor first for basic setup
parent::__construct();
// With migrate_ui enabled, migration pages will indicate people involved in
// the particular migration, with their role and contact info. We default the
// list in the shared class; it can be overridden for specific migrations.
@favrik
favrik / template.html
Created June 8, 2012 13:11
template.html
{embed="_includes/.html-header" title="Search Results for: {exp:search:keywords}"}
{embed="_includes/.main-page-images"}
<div class="main-column-left">
<h1 class="main-page-title">Interactive Map Search Results for: <em>{exp:search:keywords}</em></h1>
{exp:gmap:init id="map" class="gmap" style="width:100%;height:200px"}
@favrik
favrik / gist:2895301
Created June 8, 2012 12:08
mod.gmap.php
diff -r 9672935d0915 ee_system/expressionengine/third_party/gmap/mod.gmap.php
--- a/ee_system/expressionengine/third_party/gmap/mod.gmap.php Fri Jun 08 04:06:51 2012 -0700
+++ b/ee_system/expressionengine/third_party/gmap/mod.gmap.php Fri Jun 08 05:08:03 2012 -0700
@@ -1582,7 +1582,7 @@
$prep_fields = $this->EE->google_maps->prep_sql_fieldname($_POST, FALSE);
- $sql = 'SELECT `exp_channel_titles`.*, `exp_channel_data`.`entry_id`, `exp_category_posts`.`cat_id`,';
+ $sql = 'SELECT `exp_channel_titles`.*, `exp_channel_titles`.`title` as `entry_title`, `exp_channel_data`.`entry_id`, `exp_category_posts`.`cat_id`,';
$where = '';