This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
old style autocompleter | |
$acvetrina = new autocompleter_field(array('name'=>'acvetrina','status'=>'modify')); | |
$acvetrina->ajax_source = site_url('admin/feedback/js_vetrine'); | |
$acvetrina->min_chars = '2'; | |
$acvetrina->record_label = 'vetrina'; | |
$acvetrina->record_id = 'ID'; | |
$acvetrina->hidden_field_id = 'id_vetrina'; | |
$acvetrina->extra_params = "category: function() { return $('#id_categoria').val() } , prov: function() { return $('#id_provincia').val() }"; | |
$acvetrina->build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error_log(print_r($var, true), 3, $_SERVER['DOCUMENT_ROOT']."/uploads/log.txt"); | |
var_dump($var); | |
die($var); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function grab_page($url, $data=array()) | |
{ | |
$agent = 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1'; | |
$referer = "http://www.bing.com"; | |
$url = str_replace(' ', '%20', $url); | |
$curl = curl_init($url); | |
curl_setopt($curl, CURLOPT_HEADER, 0); | |
curl_setopt($curl, CURLOPT_VERBOSE, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A simple Facebook PHP example. | |
* | |
* - This is not a "Facebook SDK". | |
* - This example uses Curl, Hash, JSON, Session extensions. | |
* - This does not use the JavaScript SDK, nor the cookie set by it. | |
* - This works with Canvas, Page Tabs with IFrames, the Registration Plugin | |
* and with any other flow which uses the signed_request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Tag extends Eloquent | |
{ | |
public function scopeSearch($query, $q) | |
{ | |
$match = "MATCH(`tag`, `varianti`) AGAINST (?)"; | |
return $query->whereRaw($match, array($q))->orderByRaw($match.' DESC', array($q)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Site | |
{ | |
protected static $assets = array(); | |
public static function assets() | |
{ | |
$arr = func_get_args(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class HomeController extends BaseController | |
{ | |
public function showWelcome() | |
{ | |
$articoli = Articolo::Articoli()->Pubblici()->take(4)->remember(10)->get(); | |
$primopiano = $articoli->shift(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php namespace Zofe\Filters; | |
/* | |
my customized version of jeff class https://laracasts.com/lessons/caching-essentials | |
*/ | |
use Illuminate\Routing\Route; | |
use Illuminate\Http\Request; | |
use Illuminate\Http\Response; | |
use Str; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## timthumb | |
http://timthumb.googlecode.com/svn/trunk/timthumb.php | |
(download and configure cache path) | |
## .htaccess | |
RewriteRule ^thumb/(\d+)x(\d+)/f(\d)/q(\d{2})/(.*) /public/images/timthumb.php?src=/$5&w=$1&h=$2&f=$3&q=$4 [L] | |
RewriteRule ^thumb/(\d+)x(\d+)/f(\d)/(.*) /public/images/timthumb.php?src=/$4&w=$1&h=$2&f=$3 [L] | |
RewriteRule ^thumb/(\d+)x(\d+)/(.*) /public/images/timthumb.php?src=/$3&w=$1&h=$2 [L] |
OlderNewer