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
nestable: function (child, string = 0) {
var nested = [];
child.forEach(e => {
e["push"] = ' '.repeat(string)
this.parents.push(e);
if (e.child !== null) {
nested += this.nestable(e.child, string + 2);
}
});
},
@ferdiunal
ferdiunal / helpers.php
Created September 13, 2016 20:54
Tinymce vs editörlerden blade taglarını render etmemize yarıyor.
/**
* Tinymce vs editörlerden blade taglarını render etmemize yarıyor.
* @param $value
* @return mixed
*/
function compile_echos($value)
{
$pattern = sprintf('/(@)?%s\s*(.+?)\s*%s(\r?\n)?/s', "{{", "}}");
$callback = function ($matches) {
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Page extends Model
{
protected $table = "pages";
protected $fillable = ["title",'slug','content','description','status','publish_at'];
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use App\Page;
class RouteServiceProvider extends ServiceProvider
{
/**
<?php
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
use App\Acme\Helpers\RequestHelper;
class EducationCreate extends FormRequest
{
use RequestHelper;
@ferdiunal
ferdiunal / RouteServiceProvider.php
Created October 21, 2016 18:59
CsrfToken checked from url
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
@ferdiunal
ferdiunal / .htaccess
Created November 3, 2016 19:14
Laravel'i paylaşımlı sunucuda çalıştırmak için
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
/* =========================================================
* bootstrap-treeview.js v1.2.0
* =========================================================
* Copyright 2013 Jonathan Miles
* Project URL : http://www.jondmiles.com/bootstrap-treeview
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
@ferdiunal
ferdiunal / test.go
Last active November 12, 2016 13:33
package main
import "fmt"
type familyInterface interface {
getFather() family
getMother() family
}
type family struct {
@ferdiunal
ferdiunal / tester.go
Created November 26, 2016 22:45
Tester
package main
import (
"net"
"regexp"
"strconv"
"strings"
)
var IBANS = map[string]interface{}{