Skip to content

Instantly share code, notes, and snippets.

View agutoli's full-sized avatar
🎯
Focusing

Bruno Agutoli agutoli

🎯
Focusing
View GitHub Profile
@agutoli
agutoli / gist:1302562
Created October 20, 2011 22:21
this is the syntax I'm using
$filters = array(
'chapeu' => array('StripTags', 'HtmlEntities'),
'corpo' => 'HtmlEntities',
'titulo' => array( 'HtmlEntities'),
'alias' => array(
'StripTags',
'StringToLower',
new Zag_Filter_CharConvert(null,null)
),
'lide' => 'HtmlEntities',
@agutoli
agutoli / example_01.txt
Created November 21, 2011 19:19
1) Passing parameter as array
$filter1 = new Zag_Filter_CharConvert(array(
'replaceWhiteSpace' => '-',
'locale' => 'en_US',
'charset'=> 'UTF-8'
));
echo $filter1->filter('ééé ááá 90');//eee-aaa-90
echo $filter1->filter('óóó 10aáééé');//ooo-10aaeee
alert(typeof(null)); // object
alert(typeof(undefined)); // undefined
alert(null !== undefined) //true
alert(null == undefined) //true
@agutoli
agutoli / gist:1838086
Created February 15, 2012 18:45
Code interpreted by God
<?php
/**
* @category gadgetXML
* @package Faz tratamento dos gadget's no XML
* @author ##### <##@####>
* @version 1.0
* @date 2008-05-06
*/
class gadget
{
@agutoli
agutoli / class_power_ranger.php
Created March 15, 2012 22:15
A class power ranger
<?php
class PowerRanger {
public function get_classificacao()
{
@agutoli
agutoli / example.php
Created March 24, 2012 04:29
Example Zend_View
<?php
/** dependencies **/
require 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true);
$view = new Zend_View;
$view->example_function_of_view();
@agutoli
agutoli / hadoop.log
Created March 29, 2012 00:00
hadoop.log
...
2012-03-28 18:45:25,442 INFO solr.SolrIndexer - SolrIndexer: starting at 2012-03-28 18:45:25
2012-03-28 18:45:25,628 INFO indexer.IndexerMapReduce - IndexerMapReduce: crawldb: crawl/crawldb
2012-03-28 18:45:25,628 INFO indexer.IndexerMapReduce - IndexerMapReduce: linkdb: crawl/linkdb
2012-03-28 18:45:25,628 INFO indexer.IndexerMapReduce - IndexerMapReduces: adding segment: crawl/segments/20120328181747
2012-03-28 18:45:25,981 INFO indexer.IndexerMapReduce - IndexerMapReduces: adding segment: crawl/segments/20120328182718
2012-03-28 18:45:27,042 WARN util.NativeCodeLoader - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
2012-03-28 18:45:28,567 INFO plugin.PluginRepository - Plugins: looking in: /home/btlagutoli/Downloads/apache-nutch-1.4-bin/runtime/local/plugins
2012-03-28 18:45:29,237 INFO plugin.PluginRepository - Plugin Auto-activation mode: [true]
2012-03-28 18:45:29,237 INFO plugin.PluginRepository - Registered Plugins:
@agutoli
agutoli / example1.php
Created April 9, 2012 22:20
Example of Kelly Hallman
<?php
...
function loadUserPrefs($username){
$default = parse_ini_file(APPLICATION_PATH.'/configs/prefs.ini');
$table = $this->getPrefsTable();
$query = $table->select()->where('username = ?',$username);
if (count($result = $table->fetchAll($query))) {
return array_merge($default,$row->toArray());
@agutoli
agutoli / example1.html
Created April 18, 2012 02:56
Example: Backbone Model
<!DOCTYPE html>
<html id="home" lang="en">
<head>
<meta charset=utf-8 />
<meta name="viewport" content="width=620" />
<title>Backbone - examples</title>
<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<script src="http://documentcloud.github.com/backbone/backbone-min.js"></script>
<script>
@agutoli
agutoli / bin.php
Created May 16, 2012 23:41
binary code
<?php
class Iptc {
/**
* IPTC's codes
*/
const OBJECT_NAME = '005';//título da imagem
const EDIT_STATUS = '007';
const PRIORITY = '010';