Skip to content

Instantly share code, notes, and snippets.

Тест на зание веб технологий

Всего ~ 58 вопросов, 125 баллов. На отлично нужно набрать > 100

1 час 30 минут на весь тест. Это около 1.5 минуты на вопрос.

PHP, Linux, MySQL

Какие в POSIX системе права на файл test.txt установит следующий PHP-код: chmod('test.txt', 777)? (2)

(function () {
'use strict';
angular.module('myApp')
.controller('SomeCtrl', SomeCtrl);
SomeCtrl.$inject = ['$scope', '$http', ' alertService'];
function SomeCtrl($scope, $http, alertService) {
$http.put('http://some.url/user/44', {
@e-kostylov
e-kostylov / 1.How to easily implement a REST API with oAuth2 presentation.md
Created February 9, 2016 09:15 — forked from lologhi/1.How to easily implement a REST API with oAuth2 presentation.md
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. :

@e-kostylov
e-kostylov / 0_reuse_code.js
Created March 23, 2016 15:39
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@e-kostylov
e-kostylov / README.md
Created June 1, 2016 12:03 — forked from tjamps/README.md
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 :

@e-kostylov
e-kostylov / Install-php7.md
Created September 3, 2016 20:08 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions
function factorial($n)
{
if ($n == 1) {
return $n;
}
return $n * factorial($n-1);
}
function tail_factorial($n, $acc = 1)
{
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
# Set magic variables for current file & dir
__dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
__file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
apt-add-repository ppa:pakin/other
apt-get update
apt-get install libapache2-apachemobilefilter-perl
FROM php:7.0-fpm
MAINTAINER ed <arsenal1988ed@gmail.com>
RUN apt-get update
# Install opcache
RUN docker-php-ext-install opcache
# Install APCu
RUN pecl install apcu