Skip to content

Instantly share code, notes, and snippets.

View beregond's full-sized avatar

Szczepan Cieślik beregond

View GitHub Profile
@pytest.fixture(scope=module)
def heavy_fixture(fixture1, fixture2):
# here be dragons
@pytest.mark.parametrize(
['param1', 'param2', 'param3'],
[
(1, 0, 0),
(0, 1, 1),
@beregond
beregond / gist:9616272
Created March 18, 2014 09:04
For VIM config
set nofoldenable
set title
let g:syntastic_python_checkers=['python', 'pylama', 'py3kwarn']
au BufEnter * set cc=80
@beregond
beregond / response.json
Created January 3, 2014 21:12
[devlog] API response example 4.
{
"data2": "testa",
"data3": "guess who is missing?",
"some_metadata": {
"foo": ["baz", "bar"]
},
"version": "2.0"
}
@beregond
beregond / response.json
Created January 3, 2014 21:08
[devlog] API response example 3.
{
"data": "chuck",
"data2": "testa",
"some_metadata": {
"foo": ["baz", "bar"]
},
"version": "1.3"
}
@beregond
beregond / response.json
Created January 3, 2014 20:48
[devlog] API response example 2.
{
"data2": "testa",
"data3": "guess who is missing?",
"some_metadata": {
"foo": ["baz", "bar"]
}
}
@beregond
beregond / response.json
Last active January 2, 2016 03:49
[devlog] API response example 1.
{
"data": "chuck",
"data2": "testa",
"some_metadata": {
"foo": ["baz", "bar"]
}
}
@beregond
beregond / gist:4373142
Last active February 7, 2022 14:41
Allows to abandon necessity to define all setters and getters in Doctrine's entities (works perfectly with Symfony + Doctrine + Twig).
<?php
namespace Vendor\TestBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Gneral class for all entities.
*/
@beregond
beregond / TemporaryFiles.php
Created July 14, 2012 12:13
Classes to help handle temporary files (also creation of such, but also 'checking' files to be removed after scripts end).
<?php
/**
* File contains two classes to help maintaining temporary files (especially problem of
* cleaning up such files) - FileToRemove and TemporaryFile.
*
* Requires PHP >= 5.3.0 (tested with 5.3.10-1)
*/
namespace Vendorname;