Skip to content

Instantly share code, notes, and snippets.

View gerlv's full-sized avatar

Oleg Gera gerlv

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gerlv on github.
  • I am oleggera (https://keybase.io/oleggera) on keybase.
  • I have a public key ASDj2ssTQeTV0T6pcYCDC9MRH2PBcPhdeINEGu_wpM_d4Qo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am gerlv on github.
  • I am oleggera (https://keybase.io/oleggera) on keybase.
  • I have a public key ASDj2ssTQeTV0T6pcYCDC9MRH2PBcPhdeINEGu_wpM_d4Qo

To claim this, I am signing this object:

@gerlv
gerlv / squid.conf
Created March 7, 2015 18:04
Squid config
acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
acl localnet src fc00::/7 # RFC 4193 local private network range
acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
@gerlv
gerlv / project.conf
Created October 2, 2011 20:48
Nginx configuration for Symfony2
location ~ \.php$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index app.php;
fastcgi_param SYMFONY__ENV stage;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /var/sites/ProjectName/staging/project/web$fastcgi_script_name;
}
@gerlv
gerlv / CreateXmlFile.php
Created November 24, 2010 17:27
Create XML file with PHP5. More resources on web development: http://webdev.ger.lv
<?php
$_emailEnabled = 'true';
$_emailStatus = 'not_started';
$_emailSubject = 'Subject 1';
$_emailBody = 'Body 1 & etc \'\' <div></div>';
$fileName = 'test.xml';
if(!file_exists($fileName)) {
touch($fileName);
}
@gerlv
gerlv / gist:712696
Created November 23, 2010 22:48
How to use Gerlv NoSQL Log writer for Zend Framework
<?php
$writer = Gerlv_Log::factory(array(
'db' => 'pext_logging',
'collection' => 'logs'
));
$logger = new Zend_Log($writer);
//$filter = new Zend_Log_Filter_Priority(Zend_Log::CRIT);
$filter = new Zend_Log_Filter_Priority(Zend_Log::INFO);
$logger->addFilter($filter);
$logger->info('Logged');
<?php
class Users extends Model {
public function __construct() {
parent::__construct();
}
public function test() {
$_data = array(
'field1' => 'value1',