Skip to content

Instantly share code, notes, and snippets.

@morozow
morozow / versionings.md
Last active December 25, 2018 15:25
Инструмент автоматизации управления версиями

Инструмент автоматизации управления версиями

Версионирование

Версионирование — разработка и управление несколькими выпусками продукта, которые имеют тот же общий функционал, но усовершенствованы, модернизированы либо индивидуализированы. Коротко, версия говорит об изменении продукта. Как версия говорит об изменении продукта? Давайте назовем систему упорядочивания символов для обозначения версии продукта — схемой версионирования. Различные схемы версионирования были созданы для отслеживания версий различного программного обеспечения.

Semantic Versioning: Major.Minor.Patch

Схем версионирования много, но мы сталкиваемся с Семантическим версионированием (Semantic Versioning) каждый день. Для Семантического версионирования характерно то, что номера версий и то, как они меняются, передают смысл содержания исходного кода и какие модификации были применены от одной версии к другой. Рассмотрим, каким образом формируется номер Семантической версии.

Patch version, обратно совместимые исправления: n.n.X

@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@DragonBe
DragonBe / php_conferences_2016.md
Last active February 9, 2018 08:02
Overview of PHP oriented conferences in 2016 (excluding polyglot and framework oriented conferences)
@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@morozow
morozow / getAncestorsByTree.php
Last active August 29, 2015 14:16
This recurcive function build full path for nested set node by classic array
<?php
/**
* This recurcive function build full path for nested set node by classic array
*
* @param $tree
* @param $needle
* @param array $path
* @return array|bool
*/
@lologhi
lologhi / 1.How to easily implement a REST API with oAuth2 presentation.md
Last active April 4, 2024 22:13
Symfony2 : How to easily implement a REST API with oAuth2 (for normal guys)

It's still a work in progress...

Intro

As William Durand was recently explaining in his SOS, he "didn't see any other interesting blog post about REST with Symfony recently unfortunately". After spending some long hours to implement an API strongly secured with oAuth, I thought it was time for me to purpose my simple explanation of how to do it.

Ok, you know the bundles

You might have already seen some good explanation of how to easily create a REST API with Symfony2. There are famous really good bundles a.k.a. :

@toranb
toranb / Gruntfile.js
Created November 7, 2013 14:09
basic grunt file for ember.js including a dev and deploy task
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-ember-template-compiler');
grunt.loadNpmTasks('grunt-hashres');
grunt.initConfig({
watch: {
scripts: {
files: ['foo/static/something_ui/js/app/*.js', 'foo/static/something_ui/templates/*.handlebars'],
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.
@tawfekov
tawfekov / generator.php
Last active March 2, 2024 16:06
Doctrine2 Generate Entities form Existing Database
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();