Skip to content

Instantly share code, notes, and snippets.

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

Ferdi ÜNAL ferdiunal

🏠
Working from home
View GitHub Profile
@ferdiunal
ferdiunal / Application.php
Created June 11, 2016 19:31
Laravel Custom Directory
<?php
namespace Lib;
use Illuminate\Foundation\Application as Laravel;
/**
* @name Ferdi ÜNAL
* @email [email protected]
*/
class Application extends Laravel
{
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
@ferdiunal
ferdiunal / array2json.php
Last active June 27, 2023 00:54
Ülkelerin İl, İlçeleri. Şimdilik Türkiye'yi ekleyebildim.
#!/usr/bin/env php
<?php
/**
* @author Ferdi ÜNAL
* @email [email protected]
*/
$location = require "location.php";
$json = fopen('location.json', 'w');
@ferdiunal
ferdiunal / routes.php
Last active June 22, 2016 09:12
Laravel'de farklı dizindeki dosyaları kendi oluşturduğumuz url'ler ile nasıl göstereceğimizi aşağıda belirttim. $path değişkeni sizin dosyanızın yolunu belirler.
<?php
/***
* Laravel'de farklı dizindeki dosyaları kendi oluşturduğumuz url'ler ile
* nasıl göstereceğimizi aşağıda belirttim.
* $path değişkeni sizin dosyanızın yolunu belirler.
*/
Route::get('/img/{user_id}/{filename}',function($userId,$filename){
$path = public_path("upload/users/{$userId}/{$filename}");
if(!\File::isFile($path)){
abort(404,"Dosya bulunamadı !");
@ferdiunal
ferdiunal / app.py
Created July 9, 2016 18:49
Pyqt5 QDialog simge durumuna küçült, tam ekran yap. butonları
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialog
class Editor(QDialog):
def __init__(self,parent=None,path=None):
super().__init__(parent)
self.path=path
self.initUI()
def initUI(self) :
self.setWindowFlags(self.windowFlags() | Qt.WindowMinimizeButtonHint | Qt.WindowMaximizeButtonHint | Qt.WindowStaysOnBottomHint)
@ferdiunal
ferdiunal / AppServiceProvider.php
Created August 22, 2016 07:04
Google reCaptcha Validator
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
@ferdiunal
ferdiunal / Reminder.php
Created August 22, 2016 07:34
Reminder Requests
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
class Reminder extends Request
{
/**
* Determine if the user is authorized to make this request.
<?php
use App\Http\Requests\Reminder as Request;
public function store(Request $request){
return $request->all();
}
const DATA = $(formId).serialize();
const URL = $(formId).attr('action');
$.ajax({
url: URL,
data: DATA,
success: function (e) {
alertify.success('Tamamdır :)')
},
error: function (e) {
const data = e.responseJSON;
@section('form')
<form class="ui form" action="{!! route(config('dencol.auth.routes.reminder.post.args.as')) !!}"
method="post" autocomplete="off" novalidate onsubmit="return false;" id="reminderForm">
<div class="ui segment" style="text-align: left;">
<div class="field">
<div class="ui left icon input">
<i class="user icon"></i>
<input type="text" name="email" placeholder="E-posta adresin" value="{!! old('email') !!}">
</div>
</div>