Skip to content

Instantly share code, notes, and snippets.

View jkanclerz's full-sized avatar
🎯
Focusing

Jakub Kanclerz jkanclerz

🎯
Focusing
View GitHub Profile
@jkanclerz
jkanclerz / style.css
Created May 5, 2014 07:51
Fix div(element) element hight 0
#element:after, .element:after {
content: "";
display: block;
height: 0;
clear: both;
visibility: hidden;
}
create database databasename;
create user 'user' identified by 'password';
grant all privileges on databasename.* to 'user'@localhost identified by 'password';
grant all privileges on databasename.* to 'user'@host;
grant all privileges on databasename.* to 'user'@%;
@jkanclerz
jkanclerz / Kernel.php
Last active August 29, 2015 14:07
Vagrant Env SF2 - Kernel Mod
public function getCacheDir()
{
if ($this->isVagrantEnvironment()) {
return '/dev/shm/project/cache/'.$this->environment;
}
return parent::getCacheDir();
}
public function getLogDir()
@jkanclerz
jkanclerz / PaymentHandler.php
Last active August 29, 2015 14:14
Redirect to dotpay - Pay Action
<?php
namespace Jkanclerz\DemoBundle\Payment;
use Symfony\Component\HttpFoundation\Request;
class PaymentHandler
{
const TRANSACTION_OK = 'OK';
const TRANSACTION_ERROR = 'ERROR';
class CallbackExecutor
{
protected $callback;
public function __call($method, $args)
{
if(is_callable(array($this, $method))) {
return call_user_func_array($this->$method, $args);
}
// else throw exception
@jkanclerz
jkanclerz / gist:f8cd0adb5f01ae007fe0
Created April 28, 2015 15:13
Linux NFS Redundant Storage

Redundant storage with NFS & Heartbeat

Wymagane zależności

apt get install ntp drbd8-utils heartbeat

Zróbmy to!

@jkanclerz
jkanclerz / installrabbitmq.md
Last active August 29, 2015 14:21
install rabbitmq
@jkanclerz
jkanclerz / dbMonitor.sh
Created September 22, 2015 11:05
Bash db connection monitoe
#!/bin/bash
user='user'
pass='pass'
host='host'
cmd="mysql -u $user -p$pass -h $host -e 'SHOW GLOBAL STATUS;'"
remoteCall='uptime'
if ! /bin/bash -c "$cmd";
then
WebApp
@jkanclerz
jkanclerz / behat-reference.feature
Created August 10, 2016 13:18 — forked from mnapoli/behat-reference.feature
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page