Skip to content

Instantly share code, notes, and snippets.

@jakzal
jakzal / sc-seca.c.patch
Created November 13, 2010 21:00
Dirty fix for invalid PBM mask calculation in sasc-ng
--- sc-clean/systems/sc-seca/sc-seca.c 2010-11-13 21:23:27.178801999 +0100
+++ sc/systems/sc-seca/sc-seca.c 2010-11-13 19:28:42.290801995 +0100
@@ -274,6 +274,7 @@
bool cSmartCardSeca::CheckAccess(const unsigned char *data, const cProviderScSeca *p)
{
+ return true;
struct SecaChannelInfo *sci=(struct SecaChannelInfo*)data;
if(sci->date[0]>p->date[0] || (sci->date[0]==p->date[0] && sci->date[1]>p->date[1]))
return false;
@jakzal
jakzal / gist:675734
Created November 13, 2010 23:17
Ubuntu init script for sasc-ng
We couldn’t find that file to show.
@jakzal
jakzal / Nginx Configuration for PHP
Created April 13, 2011 18:07
Nginx Configuration for PHP
server {
server_name kuba.dev;
root /var/www/$host/current/web;
access_log /var/log/nginx/$host-access.log;
error_log /var/log/nginx/kuba.dev-error.log error;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
@jakzal
jakzal / ProjectConfiguration.class.php
Created April 27, 2011 15:51
Namespaced Doctrine_Cache_Apc
class ProjectConfiguration extends sfProjectConfiguration
{
public function configureDoctrine(Doctrine_Manager $manager)
{
require_once dirname(__FILE__) . '/../lib/cache/gyDoctrineCacheApc.class.php';
$cache = new gyDoctrineCacheApc();
$cache->setNamespace(md5(sfConfig::get('sf_root_dir')));
$manager->setAttribute(Doctrine_Core::ATTR_QUERY_CACHE, $cacheDriver);
@jakzal
jakzal / TagCloud.php
Created May 26, 2011 19:39
Tag Cloud in PHP
<?php
/*
* This file is part of the PSSBlogBundle package.
*
* (c) Jakub Zalas <jakub@zalas.pl>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@jakzal
jakzal / BehatTest.php
Created October 19, 2011 14:47
Running Behat in PHPUnit to calculate code coverage
<?php
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\ConsoleOutput;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Behat\BehatBundle\Command\BehatCommand;
class BehatTest extends KernelAwareTest
{
/**
@jakzal
jakzal / deploy.rb
Created October 25, 2011 11:41
parameters.yml configuration during capifony deployment for Symfony2
set :shared_files, [app_path + "/config/parameters.yml"]
namespace :symfony do
namespace :configure do
def shared_parameters_path
"#{shared_path}/#{app_path}/config/parameters.yml"
end
def app_parameters_path
"#{latest_release}/#{app_path}/config/parameters.yml"
@jakzal
jakzal / KernelAwareTest.php
Last active October 16, 2022 11:08
KernelAwareTest
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{
@jakzal
jakzal / proxy.php
Created November 10, 2011 18:31
PHP Proxy
<?php
require_once __DIR__.'/../vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';
$loader = new Symfony\Component\ClassLoader\UniversalClassLoader();
$loader->registerNamespaces(array(
'Symfony' => __DIR__.'/../vendor/symfony/src',
'Buzz' => __DIR__.'/../vendor/buzz/lib'
));
$loader->register();
@jakzal
jakzal / deploy.rb
Created November 28, 2011 16:11
Updating assets version before assetic dump (capifony)
namespace :symfony do
namespace :assets do
desc "Updates assets version"
task :update_version do
run "sed -i 's/\\(assets_version: \\)\\(.*\\)$/\\1 #{real_revision}/g' #{latest_release}/app/config/config.yml"
end
end
end
before "symfony:assetic:dump" do