Skip to content

Instantly share code, notes, and snippets.

View skowron-line's full-sized avatar

K.Skaradziński skowron-line

  • Warsaw
View GitHub Profile
@skowron-line
skowron-line / Article.php
Created September 25, 2020 11:37 — forked from kunicmarko20/Article.php
Symfony Second Level Cache
<?php
namespace AppBundle\Entity;
/**
* @package AppBundle\Entity
* @ORM\Entity()
* @ORM\Table()
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
*/
public function byId(string $id)
{
$query = [
'source' => [
'query' => [
'query_string' => [
'fields' => ['id'],
'query' => $id,
],
],
@skowron-line
skowron-line / Money.php
Last active June 30, 2017 19:47
Money format, and money amount in words
<?php
/**
* @author Krzysztof Skaradziński <[email protected]>
*/
class Money
{
/**
* @param $value
*
@skowron-line
skowron-line / lazy services.md
Last active November 30, 2016 15:16
ocramius/proxy-manager v1.0.2 bug
@skowron-line
skowron-line / monolog.json
Last active December 30, 2023 18:58
lnav Monolog format
{
"monolog": {
"title": "Monolog log file",
"description": "Monolog log format",
"url": "https://github.com/Seldaek/monolog",
"regex": {
"default": {
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])"
}
},
@skowron-line
skowron-line / d2
Last active August 29, 2015 14:05
<?php
//Settlement
/**
* @ORM\ManyToOne(targetEntity="Certificate\LocalizationBundle\Entity\Localization", inversedBy="settlement")
*/
private $localization;
//Localization
/**
* @ORM\OneToMany(targetEntity="Certificate\LocalizationBundle\Entity\LocalizationSettlement", mappedBy="localization", cascade={"persist"})
@skowron-line
skowron-line / check-uncheck.js
Last active January 2, 2016 08:28
check parent elements, uncheck child
$.fn.checkUncheck = function(options){
var defaults = {
onCheck: jQuery.noop,
onUnCheck: jQuery.noop
};
settings = $.extend({}, defaults, options);
$(this).each(function(){
var e = $(this);
e.click(function(){
if(e[0].checked) {
<?php defined('SYSPATH') or die('No direct access allowed.');
/**
*
* @author skowron-line
*/
class DB extends Kohana_DB {
public static $_cache_driver = 'file';
public static $_log_query = false;
private static $_transaction = false;
@skowron-line
skowron-line / table.css
Last active December 24, 2015 03:59
table.css extend version for bootstrap 2.3.2 Example: http://skowronline.pl/table/
/*
http://skowronline.pl/table/
*/
.ordinal {
text-align:right !important;
width: 25px;
padding-left:5px;
}
a.edit-item {
color: #FCCA8B;
@skowron-line
skowron-line / slider.js
Last active December 23, 2015 10:49
jquery slider using toggle function. Example: http://jsfiddle.net/skowron_line/ch4g8/1/
var s = $('.slider'), i = 0;
setInterval(function(){
var o = $([]);
o = o.add(s[i]);
if(i === s.length - 1) {
i = -1;
}
i++;
o = o.add(s[i]);