Skip to content

Instantly share code, notes, and snippets.

View ahilles107's full-sized avatar

Paweł Mikołajczuk ahilles107

View GitHub Profile
#!/bin/bash
# NOTE: This file is generated by script.
# Modify "tpl/*" and run "./fire gen-files"
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -exuo pipefail
export DEBIAN_FRONTEND=noninteractive
export DBUS_SESSION_BUS_ADDRESS=/dev/null
const Answer = sequelize.define("question_option", {
id: {
type: Sequelize.INTEGER,
autoIncrement: true,
primaryKey: true
},
quiz_question_id: {
type: Sequelize.INTEGER,
},
text: {
const Sequelize = require('sequelize');
const sequelize = new Sequelize('heroku_94b79d07738d7b2', 'be1ac71986aa53', '9c18215d', {
host: 'us-cdbr-iron-east-03.cleardb.net',
dialect: 'mysql',
pool: {
max: 10,
min: 0,
idle: 10000
},
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
# builtin VCL. The builtin VCL is called when there is no explicit
# return statement.
#
# See the VCL chapters in the Users Guide at https://www.varnish-cache.org/docs/
# and https://www.varnish-cache.org/trac/wiki/VCLExamples for more examples.
{
"pubstatus":"usable",
"subject":[
{
"name":"photography",
"code":"01013000"
}
],
"urgency":3,
"associations":{
$scope.submit = function() {
$scope.upload($scope.file);
};
// upload on file select or drop
$scope.upload = function (file) {
Upload.upload({
url: 'upload/url',
data: {file: file, 'username': $scope.username}
}).then(function (resp) {
/**
* Constructor.
*
* @param ViewHandlerInterface $viewHandler
* @param bool $forceView
*/
public function __construct(ViewHandlerInterface $viewHandler, $forceView)
{
$this->viewHandler = $viewHandler;
$this->forceView = $forceView;
@ahilles107
ahilles107 / ViewResponseListener_and_zone_checking
Created March 11, 2016 22:02
ViewResponseListener return false asap when request is not covered by zone
public function onKernelView(GetResponseForControllerResultEvent $event)
{
$request = $event->getRequest();
if (!$request->attributes->get(FOSRestBundle::ZONE_ATTRIBUTE, true)) {
return false;
}
@ahilles107
ahilles107 / enable_zones_in_fos_rest
Created March 11, 2016 21:56
Enable zones feature in FOSRestBundle
# app/config/config.yml
fos_rest:
zone:
- { path: ^/api/* }
<theme>
....
<articlesLists> # main section
# single playlist declaration, if playlist not exists on theme assigning action then it will be created automaticaly
<list name="FrontPage">
<template file="article.tpl" /> # single template file assigned to playlist declaration
</list>
<list name="Second Playlist">
<template file="issue.tpl" />
<template file="front.tpl" />