Skip to content

Instantly share code, notes, and snippets.

View mssoylu's full-sized avatar
🏠
Working from home

Mehmet Soylu mssoylu

🏠
Working from home
View GitHub Profile
@GrzegorzBandur
GrzegorzBandur / Readme.md
Last active January 23, 2022 09:54
RESTful API with Symfony 4.4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle

RESTful API with Symfony 4.4 + FOSRestBundle + FOSOauthServerBundle + FOSUserBundle

To start writing RestFull API in symfony we will need bundles:

        "friendsofsymfony/oauth-server-bundle": "^1.6",
        "friendsofsymfony/rest-bundle": "^2.7",
        "friendsofsymfony/user-bundle": "^2.1",
        "jms/serializer-bundle": "^3.5",
        "nelmio/api-doc-bundle": "^3.5",
        "sensio/framework-extra-bundle": "^5.2",
        "symfony/apache-pack": "^1.0",
@mssoylu
mssoylu / gist:c9dabc2b4e7c0ecacd7658a24c6ac687
Created April 22, 2018 02:21
product tags filter sql query sample
SELECT
p.*,
(SELECT GROUP_CONCAT(rel.grup_tag_admin_name) FROM product_grup_tag_relation AS rel WHERE p.admin_name = rel.product_admin_name) AS gan,
(SELECT ei.thumb_path FROM product_images AS ei WHERE ei.product_admin_name = p.admin_name ORDER BY ei.cover DESC LIMIT 1) AS thumb_path
FROM product AS p
WHERE p.lang='tr'
GROUP BY p.id
DESC
HAVING gan LIKE '%5ad217158154e%'
import React, { Component } from 'react';
class App extends Component {
constructor(props) {
super(props);
this.state = { deger: 0 }
this.arttirFunction = this.arttirFunction.bind(this)
}
arttirFunction() {
this.setState({ deger: this.state.deger + 1 })
}
# Author : Sohail Salehi <info@soolan.com>
#
# Hello. My name is Sohail Salehi and I am a fullstack web developer.
# I would love to bring years of my experience to your projects.
# remote/onsite projects are welcome.
# Please check my CV and let me know if I could be any help.
# http://soolan.com
Install postgresql under debian:
@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 :

@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. :

@scmx
scmx / upgrade-install-ruby-2-1-2-ubuntu-12-04.md
Last active November 6, 2019 15:31
Upgrade/Install ruby 2.1.2 #ubuntu #12.04 #14.04

Upgrade/Install ruby 2.1.2

ubuntu 12.04 14.04

Reference http://stackoverflow.com/a/18490935/2037928

Login as root

Install needed packages

apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
@bchumney
bchumney / cloud9-redis-usage.txt
Created October 21, 2013 17:48
Cloud 9 Redis Usage
nada-nix install redis
redis-server --port 16379 --bind $IP
./redis-cli -h $IP -p 16379
//Persistent
echo "bind $IP\nport 16379" > redis.conf