Skip to content

Instantly share code, notes, and snippets.

View andreia's full-sized avatar
❤️
coding

Andréia Bohner andreia

❤️
coding
View GitHub Profile
<?php
$c = new Criteria();
$c->add(AutorPeer::NOME_AUTOR, strtr($this->filters['autor'], ‘*’, ‘%’), Criteria::LIKE);
$c->setIgnoreCase(true);
...
CREATE SEQUENCE SEQ_MYTABLE INCREMENT BY 1 START WITH 1 NOMAXVALUE NOCYCLE NOCACHE ORDER;
UPDATE MYTABLE SET ID = SEQ_MYTABLE.nextval;
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
select * from NLS_DATABASE_PARAMETERS;
<?php
echo Doctrine::VERSION;
@andreia
andreia / gist:415746
Created May 27, 2010 12:32
Gerar código de verificação da Redecard
<?php
// gerar código de verificação da Redecard
function redecardCodver($varFiliacao, $varTotal, $varEndIP){
$dataAtual = getdate();
$segundosAtuais = $dataAtual['seconds'];
$segundosCodificados = array(11,17,21,31,56,34,42,3,18,13,12,18,22,32,57,35,43,4,19,14,9,20,23,33,58,36,44,5,24,15,62,25,34,59,37,45,6,25,16,27,63,26,35,60,38,46,7,26,17,28,14,36,2,39,47,8,29,22,55,33);
$i = $segundosCodificados[$segundosAtuais];
#mydiv ul {
margin-left: 0;
padding-left: 0;
display: inline;
}
#mydiv ul li {
margin-left: 0;
padding-left: 2px;
list-style: none;
$ git checkout master
$ git remote add username git://github.com/username/repo.git
$ git fetch username
$ git merge username/master
$ git push origin master
@andreia
andreia / _form.php
Created September 17, 2010 03:17
form iterator - sf 1.4
<div class="ui-corner-all">
<?php foreach($form->getFormFieldSchema() as $formField): ?>
<div class="form_field_<?php echo $formField->getName() ?><?php $formField->hasError() and print ' ui-state-error ui-corner-all' ?>">
<div class="label ui-helper-clearfix">
<?php echo $formField->renderLabel(); ?>
</div>
<?php if($help = $formField->renderHelp()): ?>
<div class="help">
<span class="ui-icon ui-icon-help floatleft"></span>
@andreia
andreia / location.html
Created November 9, 2010 15:11
Geolocation using W3C Geolocation API - http://dev.w3.org/geo/api/spec-source.html
<html>
<head>
<title>Example: Geolocation using W3C Geolocation API</title>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
function initialize(){
var myOptions = { zoom: 8, mapTypeId: google.maps.MapTypeId.HYBRID };
var map = new google.maps.Map(document.getElementById("map"), myOptions);