Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Burakhan Özyol Burakhan

🎯
Focusing
Block or report user

Report or block Burakhan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Burakhan
Burakhan / csv.php
Last active Feb 8, 2019
symfony csv semicon reader
View csv.php
$serializer = $this->getContainter('serializer');
$data = $serializer->decode(file_get_contents('./data/tum_kazanimlar.csv'), 'csv', ['csv_delimiter' => ';']);
for($i = 0; $i < 2 ; $i++) {
dump($data[$i]);
}
View gist:06e9ca6e136519d256254c6f4a81d56a
#EXTM3U
#EXT-X-STREAM-INF:BANDWIDTH=390000,CODECS="avc1.4d0015,mp4a.40.2",RESOLUTION=426x240
http://www.youtube.com/api/manifest/hls_playlist/id/5025ba90a349f1cc/itag/92/source/yt_live_broadcast/ratebypass/yes/cmbypass/yes/playlist_type/LIVE/maudio/1/pmbypass/yes/upn/Rwg0UFeZvSM/sver/3/ip/85.30.32.34/ipbits/8/expire/1346084679/sparams/ip,ipbits,expire,id,itag,source,ratebypass,cmbypass,playlist_type,maudio,pmbypass/signature/3119B02572030AFBACA74E48C615B33E1EC9B0F7.40D6BBE13D23D9A6EDDD0156F788D6A02F1B54E8/key/ck1/file/index.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=1337000,CODECS="avc1.4d001e,mp4a.40.2",RESOLUTION=640x360
http://www.youtube.com/api/manifest/hls_playlist/id/5025ba90a349f1cc/itag/93/source/yt_live_broadcast/ratebypass/yes/cmbypass/yes/playlist_type/LIVE/maudio/1/pmbypass/yes/upn/Rwg0UFeZvSM/sver/3/ip/85.30.32.34/ipbits/8/expire/1346084679/sparams/ip,ipbits,expire,id,itag,source,ratebypass,cmbypass,playlist_type,maudio,pmbypass/signature/0C01ACC5F2B8525D9EC14CC0A220D78604A42BFB.351021DBDB4CEEF0DDA9148769
@Burakhan
Burakhan / install_ffmpeg_ubuntu.sh
Last active Jun 1, 2018 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
View install_ffmpeg_ubuntu.sh
#!/bin/bash
cd wget https://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.gz
tar xzvf nasm-2.13.03.tar.gz
cd nasm-2.13.03
./configure
make
make install
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
View admin.py
from django.contrib import admin
from .models import Post
admin.site.register(Post)
@Burakhan
Burakhan / cx_oracle.md
Created Mar 8, 2018 — forked from kimus/cx_oracle.md
Installing python cx_oracle on Ubuntu
View cx_oracle.md

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@Burakhan
Burakhan / delete_cascade.sql
Created Dec 31, 2016
postgres cascade delete
View delete_cascade.sql
-- select delete_cascade('public','my_table','1');
create or replace function delete_cascade(p_schema varchar, p_table varchar, p_key varchar, p_recursion varchar[] default null)
returns integer as $$
declare
rx record;
rd record;
v_sql varchar;
v_recursion_key varchar;
recnum integer;
v_primary_key varchar;
@Burakhan
Burakhan / my_sacrifice.md
Created Nov 8, 2016
The motherf*cking way the get Oracle access in PHP5 over Ubuntu
View my_sacrifice.md
@Burakhan
Burakhan / index.xml.twig
Created May 6, 2014
Syfony Simple Sitemap
View index.xml.twig
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{% for url in urls %}
<url>{# check if hostname is not alreay in url#}
<loc>http://{%if url.loc|replace({hostname:''}) == url.loc%}{{hostname}}{{url.loc}}{%else%}{{url.loc}}{%endif%}</loc>
{% if url.lastmod is defined %}
<lastmod>{{url.lastmod}}</lastmod>
{% endif %}
{% if url.changefreq is defined %}
<changefreq>{{url.changefreq}}</changefreq>
View 1-Explanations.md

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.
You can’t perform that action at this time.