Skip to content

Instantly share code, notes, and snippets.

View petrjasek's full-sized avatar
🏡
Working from home

Petr Jašek petrjasek

🏡
Working from home
View GitHub Profile
Array
(
[phpSettings] => Array
(
[display_startup_errors] => 0
[display_errors] => 0
)
[includePaths] => Array
(
@petrjasek
petrjasek / TestController.php
Created September 3, 2012 14:58
Controller example
<?php
class TestController extends Zend_Controller_Action
{
public function indexAction()
{
$this->view->message = "Test controller";
}
}
@petrjasek
petrjasek / asset.test.tpl
Last active December 12, 2015 04:18
how to test templates
{{ test }}
{{ asset file="foo.css" dest="bar.css" }}
{{ assert_equals }}/static/bar.css{{ /assert_equals }}
{{ /test }}
{{ assert }}
{{ asset file="foo.css" dest="bar.css" }}
{{ equals }}/static/bar.css{{ /equals }}
{{ /assert }}
@petrjasek
petrjasek / gist:6410488
Last active December 22, 2015 03:29
sd checkbox directive
<input type="checkbox" ng-model="item.selected" sd-custombox />
directive.js:
return {
require: '?ngModel',
link: function($scope, element, attrs, ngModel) {
element.click(function() {
$scope.$apply(function() {
ngModel.$serViewValue(!ngModel.$getViewValue());
@petrjasek
petrjasek / item.json
Created January 27, 2014 15:28
ninjs picture item
subject: [
{
name: "politics",
code: "11000000"
},
{
name: "crime, law and justice",
code: "02000000"
}
],
{
onPrepare: function() {
var reporter = new ScreenShotReporter({
baseDirectory: './screenshots',
pathBuilder: function pathBuilder(spec, descriptions, results, capabilities) {
return results.passed() + '_' + descriptions.reverse().join('-');
}
});
@petrjasek
petrjasek / app.py
Last active August 29, 2015 14:02
superdesk apps outside superdesk
from Eve import Eve
import superdesk
import superdesk.users
import superdesk.auth
app = Eve()
superdesk.init_app(app)
app.run()
@petrjasek
petrjasek / layers.py
Created September 4, 2014 14:54
layers
def controller_layer(doc):
doc['ctr'] = 1
yield doc
doc['ctr'] = 2
return doc
def service_layer(doc):
doc['srv'] = 1
yield doc
{
"headline": "market opening",
"subject": [
{
"name": "Adventure",
"parent": null,
"qcode": "patopic:ADVENTURE"
}
],
"version": 6,
@petrjasek
petrjasek / Procfile_simple
Created March 3, 2016 13:13
simple procfile
rest: gunicorn -c gunicorn_config.py wsgi
wamp: python3 -u ws.py
work: celery -A worker worker
beat: celery -A worker beat --pid=