Skip to content

Instantly share code, notes, and snippets.

View lpirola's full-sized avatar

Lucas Pirola Dias lpirola

  • São Paulo, Brazil
View GitHub Profile
<?php
App::import('Vendor', 'parsecsv', array('file'=>'parsecsv'.DS.'parsecsv.lib.php'));
?>
git update-index --assume-unchanged
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
RewriteCond %{HTTP_HOST} ^teamproject.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.teamproject.com.br$
RewriteRule ^trial8 "http\:\/\/127\.0\.0\.1\:12016%{REQUEST_URI}" [P,QSA,L]
RewriteCond %{HTTP_HOST} ^teamproject.com.br$ [OR]
RewriteCond %{HTTP_HOST} ^www.teamproject.com.br$
RewriteRule ^trial7 "http\:\/\/127\.0\.0\.1\:12015%{REQUEST_URI}" [P,QSA,L]
RewriteCond %{HTTP_HOST} ^teamproject.com.br$ [OR]
<div class="indice">
<ul class="noticias">
<li class="data">19.11.2010</li>
<li class="chamada com-imagem">
<a class="img" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php"><img src="http://w3.i.uol.com.br/Wap/2010/09/15/midia-indoor-wap-o-apresentador-pedro-bial-no-cenario-do-big-brother-brasil-12010-1284572053570_80x80.jpg" width="80" height="80"></a>
<a class="hora" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php">14h36</a>
<a class="titulo" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php">Olheiros estão à procura de futuros participantes para o "BBB 11"</a>
</li>
<li class="chamada">
<a class="hora" href="http://www.natelinha.com.br/noticias/2010/11/19/142246.php">14h22</a>
<div class="indice">
<span class="first">19.11.2010</span>
<ul class="noticias">
<li class="imagem">
<a class="img" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php"><img src="http://w3.i.uol.com.br/Wap/2010/09/15/midia-indoor-wap-o-apresentador-pedro-bial-no-cenario-do-big-brother-brasil-12010-1284572053570_80x80.jpg" width="80" height="80" alt="Olheiros estão à procura de futuros participantes para o &quot;BBB 11&quot;"></a>
<a class="hora" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php">14h36</a>
<a class="titulo" href="http://natelinha.uol.com.br/noticias/2010/11/19/142246.php">Olheiros estão à procura de futuros participantes para o "BBB 11"</a>
</li>
<li>
<a class="hora" href="http://www.natelinha.com.br/noticias/2010/11/19/142246.php">14h22</a>
find . -name .svn -print0 | xargs -0 rm -r
/* INI: TIME REMAINS */
function restTime( YY , MM , DD , HH , MI, i ) {
var
SS = 00,
h = new Date(),
ff = new Date( YY , MM-1 , DD , HH , MI , SS ),
ss = parseInt( (ff - h) / 1000 ),
mm = parseInt( ss / 60 ),
hh = parseInt( mm / 60 ),
<?php
$pages = array('pele-net.php', 'retro-2010.php', 'ir-2011.php');
$current_page = $_SEVER['SCRIPT_NAME'];
$current_idx = array_search($current_page,$pages);
$next_page = $current_page[$current_idx+1];
$previous_page = $current_page[$current_idx-1];
@lpirola
lpirola / registry.js
Created March 11, 2013 18:49
Example Pattern Registry
function Registry(){
if(!this.instance){
/* object not yet created */
function registry(){ }
/* bunch of hashes for the passed object */
registry.prototype.reg = {}
/* method to add objects */
registry.prototype.add = function(name, object){
this.reg[name] = object;
}