Skip to content

Instantly share code, notes, and snippets.

View mvar's full-sized avatar

Mantas Var mvar

  • Kaunas, Lithuania
View GitHub Profile
@mvar
mvar / formController.js
Created February 26, 2016 11:47 — forked from romaricdrigon/formController.js
Using AngularJS on Symfony2 forms
// An example controller binded to the form
function FormCntl($scope, $compile) {
// Consider using FosJsRouting bundle, if you want to use a Symfony2 route
$scope.formUrl = "http://url-to-fetch-my-form";
// Data from the form will be binded here
$scope.data = {};
// Method called when submitting the form
$scope.submit = function() {
@mvar
mvar / user_premissions.md
Last active December 10, 2015 17:48
Giving user 'www-data' same permissions as normal user

Create a new group (www-pub) and add the users to that group

groupadd www-pub
usermod -a -G www-pub usera ## must use -a to append to existing groups
usermod -a -G www-pub userb

groups usera ## display groups for user
@mvar
mvar / SlugGenerator.php
Last active October 12, 2015 23:38
Makes slug from text. I.e. for SEO friendly URL
<?php
/**
* Makes SEO URL from string
*
* @author Mantas Varatiejus <var.mantas@gmail.com>
* @copyright 2011-2013, Mantas Varatiejus
*/
class SlugGenerator
{
@mvar
mvar / i18n_pluralization_lithuanian.php
Created September 30, 2012 12:26
Internationalization: Pluralization in lithuanian language
<?php
/**
* Pluralization in lithuanian language
*
* @author Mantas Varatiejus <var.mantas@gmail.com>
* @package Internationalization
*/
/**
* Returns translation index for the right plural form