Skip to content

Instantly share code, notes, and snippets.

View norberttech's full-sized avatar

Norbert Orzechowicz norberttech

View GitHub Profile
module.controller('SuperCtrl', [
'$scope',
function ($scope) {
var html = '<config config="configRow"></config>',
result = angular.doMagiaOrSomething(html, {configRow : {id 1, name:2 }});
alert(result);
}
]);
@norberttech
norberttech / REDME.md
Last active July 27, 2016 13:15
TuTu as a dependency of application that use Symfony2 HttpKernel Component

This gist presents how to use TuTu as a dependency of Symfony2 application instead of using standalone TuTu application.

Lets assume that we have clean Symfony 2.3.* standard application.
We are going to use following libraries:

First we need to prepare configs for TuTu, lets create following folders structure in our application.

# TuTu/config/config.yml
oauth_extension:
protected_configs: [] # config names that should be protected with oauth2
client:
id: "this_is_valid_client_id"
secret: "this_is_valid_client_secret"
grant_types: ["client_credentials"] # if empty all allowed | "authorization_code", "client_credentials", "password", "token", "refresh_token"
redirect_uri: [] # if empty any allowed
- name: MySQL | Set the root password.
mysql_user:
user: root
host: "{{ item }}"
password: "{{ mysql_root_db_pass }}"
with_items:
- "{{ ansible_hostname }}"
- 127.0.0.1
- ::1
- localhost
- name: Install Mysql package
apt: name={{ item }} state=installed
with_items:
- mysql-server
- python-mysqldb
- python-selinux
<?php
$users = mysql_query(<<<EOT
SELECT `users`.`id`
FROM `users`
WHERE `users`.`regkey` = ''
ORDER BY `users`.`id` DESC
LIMIT 1
<<EOT);
@norberttech
norberttech / FeatureContext.php
Created February 17, 2014 20:26
Check scenario tags
<?php
namespace FSi\Bundle\AdminBundle\Behat\Context;
use Behat\Behat\Context\BehatContext;
use Behat\Behat\Event\ScenarioEvent;
class FeatureContext extends BehatContext
{
/**
$object = new \Object();
$object->name = 'norbert';
$object->surname = 'orzechowicz';
$object->email = 'norbert@orzechowicz.pl';
$objectPreview($object);
$objectPreview->addField('name', array('propertyPath' => 'name', 'label' => 'User Name'));
$objectPreview->addField('surname', array('propertyPath' => 'surname', 'label' => 'User Surname'));
$objectPreview->addField('email', array('propertyPath' => 'email', 'label' => 'Email'));
@norberttech
norberttech / selenium-travis.yml
Last active December 28, 2015 02:39
Symfony2 Behat Selenium at travis. Remeber to change domain "example.com"
language: php
php:
- 5.3
- 5.4
- 5.5
before_install:
- sudo apt-get update > /dev/null
@norberttech
norberttech / vagrant_submodules
Created October 30, 2013 11:55
Vagrant submodules
git submodule add http://github.com/example42/puppet-apache vagrant/modules/apache
git submodule add http://github.com/puppetlabs/puppetlabs-java vagrant/modules/java
git submodule add https://github.com/puppetlabs/puppetlabs-apt.git vagrant/modules/apt
git submodule add https://github.com/vagrantee/puppet-composer.git vagrant/modules/composer
git submodule add https://github.com/puppetlabs/puppetlabs-mysql.git vagrant/modules/mysql
git submodule add https://github.com/example42/puppet-php.git vagrant/modules/php
git submodule add https://github.com/puphpet/puppet-puphpet.git vagrant/modules/puphpet
git submodule add https://github.com/example42/puppi.git vagrant/modules/puppi
git submodule add https://github.com/puppetlabs/puppetlabs-stdlib.git vagrant/modules/stdlib
git submodule add https://github.com/puphpet/puphpet-xdebug.git vagrant/modules/xdebug