Skip to content

Instantly share code, notes, and snippets.

View lahmacun's full-sized avatar
🎯
Focusing

Mustafa Zahid Efe lahmacun

🎯
Focusing
View GitHub Profile
@if (env('APP_ENV') == 'local')
<div class="debug-bar">
<div>
<b>Current Route:</b> {{ request()->route()->getName() }}
&nbsp;&nbsp;&nbsp;&nbsp;
<b>Mandatory Parameters:</b> {{ implode(', ', request()->route()->parameterNames()) }}
&nbsp;&nbsp;&nbsp;&nbsp;
<b>Method:</b> {{ request()->route()->getControllerClass() . '::' . request()->route()->getActionMethod() . '()' }}
</div>
</div>
[
'af' => 'Afrikaans',
'af_ZA' => 'Afrikaans (South Africa)',
'ar' => 'Arabic',
'ar_AE' => 'Arabic (U.A.E.)',
'ar_BH' => 'Arabic (Bahrain)',
'ar_DZ' => 'Arabic (Algeria)',
'ar_EG' => 'Arabic (Egypt)',
'ar_IQ' => 'Arabic (Iraq)',
'ar_JO' => 'Arabic (Jordan)',
Collection type ile bir alan oluşturduğumuzda bunun öncesinde form_widget kullanırsak eğer data-prototype boş geliyor.
Önce prototype'ı bir değişkene atayıp ondan sonra form_widget(form) dememiz gerekiyor. Her seferinde unutuyorum, buraya
yazayım da bari bir dahaki sefere saçlarımı yolmayayım.
var kelime = ["s", "a", "r", "ı", "m", "s", "a", "k", "l", "a", "s", "a", "k"]; // Kelimeyi butun harfler bir eleman olacak sekilde bir dizi haline getirdigimizi varsayarak basliyoruz.
var saSayisi = 0; // Toplam "sa" sayisi ilk basta 0
for (var i = 0; i < kelime.length - 1; i++) { // son harften bir onceki harfe kadar butun harfleri donguye sokuyoruz.
if ((kelime[i] + kelime[i + 1]) == "sa") { // Eger i. harf ile i + 1. harfin birlesimi "sa" ise toplam sa sayisini 1 artiriyoruz.
saSayisi ++;
}
}
console.log(saSayisi + " tane 'sa' bulundu."); // Toplam sa sayisini ekrana basip programimizi bitiriyoruz.
server {
listen 80;
server_name dummy_site.local;
# MAMP DOCUMENT_ROOT !! Don't remove this line !!
root "/Applications/MAMP/htdocs/dummy_site.local/public";
access_log /Applications/MAMP/logs/nginx_access.log;
error_log /Applications/MAMP/logs/nginx_error.log;
@lahmacun
lahmacun / Türkiye'deki İller Listesi - Satır Satır
Last active March 16, 2018 12:49
Özellikle Wordpress eklentisi olan Contact Form 7'de kullanmak için oluşturulmuş bir gisttir.
ADANA
ADIYAMAN
AFYON
AĞRI
AMASYA
ANKARA
ANTALYA
ARTVİN
AYDIN
BALIKESİR
<?php
function topla() {
$toplam = 0;
$argumanSayisi = func_num_args();
for ($i = 0; $i < $argumanSayisi; $i ++) {
$toplam += func_get_arg($i);
}
return $toplam;
}
<?php
function topla() {
$toplam = 0;
$argumanSayisi = func_num_args();
for ($i = 0; $i < $argumanSayisi; $i ++) {
$toplam += func_get_arg($i);
}
return $toplam;
}
@lahmacun
lahmacun / composer.json
Created December 30, 2017 11:00
PHPUnit Yazısı
{
"require": {
"phpunit/phpunit": "^6.5"
},
"autoload": {
"psr-4": {
"App\\": "app"
}
}
}
<?php
function topla() {
$toplam = 0;
$argumanSayisi = func_num_args();
for ($i = 0; $i < $argumanSayisi; $i ++) {
$toplam += func_get_arg($i);
}
return $toplam;
}