Skip to content

Instantly share code, notes, and snippets.

show_article:
url: /article/:articleCode-:folderCode-:variationCode-:lineCode-:seasonCode-:colorCode
class: sfDoctrineRoute
options:
model: Article
type: object
segment_separators: [/, -]
param: { module: article, action: show, sf_format: html }
show_article:
url: /article/:articleCode_:folderCode_:variationCode_:lineCode_:seasonCode_:colorCode
class: sfDoctrineRoute
options:
model: Article
type: object
segment_separators: [/, _]
param: { module: article, action: show, sf_format: html }
SELECT
se.id as id,
email.value as email,
tessera.value as tessera
FROM
sym_entries se
LEFT JOIN sym_entries_data_119 email
ON
se.id = email.entry_id
<?php
public static function generateCardNumber($uid)
{
$uid = str_pad(strrev($uid), 6, '0');
$quartine = array();
$quartine[] = str_pad(abs((131071 * $uid + 524287) % 10000), 4, '0', STR_PAD_LEFT);
$quartine[] = str_pad(abs((524287 * $uid + 131071) % 10000), 4, '0', STR_PAD_LEFT);
$quartine[] = str_pad(abs((8191 * $uid + 131071) % 10000), 4, '0', STR_PAD_LEFT);
<?php
$arrayCard = array();
for ($i = 100000; $i < 1000000; $i++)
{
$num = generateCardNumber($i);
echo "id: ".$i." card: ".$num."\n";
if(in_array($num, $arrayCard))
@cirpo
cirpo / gist:774617
Created January 11, 2011 16:01
factories.yml
dev:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
@cirpo
cirpo / gist:774602
Created January 11, 2011 15:54
cMailLogger Symfony mail logger
<?php
/**
* ncMAilLogger send mail logs messages.
*
* @package symfony
* @subpackage log
* @author alessandro cinelli a.k.a cirpo <alessandro.cinelli@gmail.com>
* @version SVN: $Id: sfFileLogger.class.php 10964 2008-08-19 18:33:50Z fabien $
*/
class cMailLogger extends sfLogger
<?php
if (!$this->config->get('config_customer_approval')) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
} else {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
}
@cirpo
cirpo / .bashrc
Created December 25, 2010 21:56
se vuoi puoi prendere spunto...
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
export EDITOR=vim
export VISUAL=vim
alias 'll=ls -lah'
alias 'zf=/usr/local/Cellar/php/5.3.3/lib/php/bin/zf.sh'
var oggettoX = function(){
var valore = 0;
return {
increment : function(inc){
valore += inc;
},
getValue: function(){
return valore;
}