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 / gecen_zaman
Created May 6, 2014 18:40
Strtotime Geçen zamanı hesaplama
// Geçen Zaman
function GecenZaman(gecenSure){
if(gecenSure){
var myDate = new Date();
var $zaman = (myDate.getTime() /1000) - gecenSure;
.filter("timeago", function () {
//time: the time
//local: compared to what time? default: now
//raw: wheter you want in a format of "5 minutes ago", or "5 minutes"
return function (time, local, raw) {
if (!time) return "never";
if (!local) {
(local = Date.now())
}
@ferdiunal
ferdiunal / mixins.scss
Last active August 29, 2015 14:11
SCSS PADDING & MARGIN RESPONSIVE MIXIN
/***
Responsive Width
**/
$screen-sm: 768px !default;
$screen-md: 992px !default;
$screen-lg: 1200px !default;
/**
Mixins
**/
@mixin pd_mg($class,$size,$type) {
@ferdiunal
ferdiunal / index.html
Created January 20, 2015 11:29
image none selected
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
@ferdiunal
ferdiunal / app.js
Last active August 29, 2015 14:14
Angularjs-ui'nin highlight filtresi ile metin içerisinde arama yapmak
'use strict';
var angApp = angular.module('MyApp', [
'ui.highlight','ngSanitize'
]);
var MainController = function ($scope,$http) {
$scope.msg = "Atatürk, gençliğe hitabında, Nutuk'un felsefesi hakkında ipuçları vermektedir.
@ferdiunal
ferdiunal / index.php
Created August 18, 2015 19:50
Laravel View location change
<?php
/***
* Move to resources/views/welcome.blade.php resources/views/default/welcome.blade.php
*/
$theme = "default";
// Admin Views
function admin_view($view, $data = [], $mergeData = []){
\View::addNamespace("admin",base_path("resources/admin"));
@ferdiunal
ferdiunal / gist:6b4dd7eacc3389327340
Created September 14, 2015 20:46
Sentinel'de kullanıcının bulunduğu rol'deki izinlerini bir türlü listelemedim, bende getRoles method'u ile birşeyler yapmaya çalıştım. https://cartalyst.com/manual/sentinel/2.0
private function myInarray($getArray = '',array $myArray = []){
// $getArray'yı noktalarından ayıralım
$getArray = explode('.',$getArray);
// Sonra foreach ile listeleyelim
foreach($getArray as $key){
// Eğer $myArray yok ise yada $myArray'da istediğimiz key yok ise
if (!is_array($myArray) || !array_key_exists($key, $myArray)) {
// Sonuç null olarak döner
<?php
/**
* Created by PhpStorm.
* User: ferdiunal
* Date: 01.04.2016
* Time: 16:05
*/
namespace Libraries;
<form action="{!! route('admin@settings.general') !!}" method="post" autocomplete="off">
{!! csrf_field() !!}
<div class="form-group">
<label for="site_name">Site Adı : </label>
<input type="text" class="form-control" id="site_name" name="settings[site_name]" placeholder="Site Adı">
@if($errors->has('settings.site_name')) <span class="help-block">{!! $errors->first('settings.site_name') !!}</span> @endif
</div>
<div class="form-group">
<label for="site_slogan">Site Sloganı : </label>
<?php
namespace Unal\Http\Requests\Admin\Settings;
use Unal\Http\Requests\Request;
class General extends Request
{
/**
* Determine if the user is authorized to make this request.