Skip to content

Instantly share code, notes, and snippets.

View pekkis's full-sized avatar

Mikko Forsström pekkis

View GitHub Profile
Add monolog to composer.json in the "require" object:
"monolog/monolog": "@stable"
// THESE GO TO NGINX CONFIG app/dev/nginx/losofacebook under server
proxy_buffer_size 2048k;
proxy_buffers 4 2048k;
proxy_busy_buffers_size 2048k;
fastcgi_buffers 8 2048k;
@pekkis
pekkis / gist:4994593
Created February 20, 2013 10:32
Gzip settings for nginx
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
@pekkis
pekkis / nginx-cache-settings
Created February 20, 2013 10:51
Cache settings for nginx
# odp
location ~* ^.+\.(odt|odp)$ {
access_log off;
gzip off;
expires 30d;
}
# non-zipped images
location ~* ^.+\.(jpg|jpeg|gif|png|ico)$ {
access_log off;
<?php
namespace Losofacebook\Command;
use Knp\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Finder\Finder;
use Keboola\Csv\CsvFile;
<?php
namespace Losofacebook\Service;
use Doctrine\DBAL\Connection;
use Imagick;
use ImagickPixel;
use Symfony\Component\HttpFoundation\Response;
use Losofacebook\Image;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Memcached;
@pekkis
pekkis / static-nginx
Created February 21, 2013 13:40
Static-domain
server {
listen 80;
server_name static.losofacebook.tunk.io;
root /home/user/losofacebook/web;
charset utf-8;
gzip on;
gzip_disable "msie6";
@pekkis
pekkis / gist:7037765
Created October 18, 2013 07:30
Janimatin gistautusta... Janimatti tykkää gistauksesta.
# Default Gzip Configuration (Set Exceptions Per Location)
gzip on;
gzip_comp_level 1;
gzip_http_version 1.1;
gzip_vary On;
gzip_proxied any;
gzip_types text/plain text/css text/xml application/xml application/xml+rss application/xml+atom text/javascript application/x-javascript application/javascript application/json;
gzip_disable "MSIE [1-6]\.";
# non-zipped images
<?php
namespace Dporssi\Janitor;
use Xi\Filelib\File\File;
use Xi\Filelib\IdentifiableDataContainer;
use Xi\Janitor\AbstractJanitor;
use Xi\Filelib\FileLibrary;
use Xi\Filelib\Publisher\Publisher;
@pekkis
pekkis / Bootstrap.php
Created July 25, 2014 06:56
Arbitrary version plugin from D-pörssi
<?php
use Xi\Filelib\Backend\Adapter\MongoBackendAdapter;
use Xi\Filelib\FileLibrary;
use Xi\Filelib\Profile\FileProfile;
use Xi\Filelib\Plugin\RandomizeNamePlugin;
use Xi\Filelib\Plugin\Image\VersionPlugin;
use Xi\Filelib\Publisher\Adapter\Filesystem\SymlinkFilesystemPublisherAdapter;
use Xi\Filelib\Storage\Adapter\FilesystemStorageAdapter;
use Xi\Filelib\Storage\Adapter\Filesystem\DirectoryIdCalculator\TimeDirectoryIdCalculator;
xi_filelib:
queue_adapter_service: 'oy_main.service.queue_adapter'
# cache_adapter_service: 'oy_main.service.cache_adapter'
renderer:
enable_acceleration: %filelib_acceleration%
add_prefix: "/protected"
strip_prefix: "%filelib_strip_prefix%"