Skip to content

Instantly share code, notes, and snippets.

View sineld's full-sized avatar
🏢
Full Stack Developer

Sinan Eldem sineld

🏢
Full Stack Developer
View GitHub Profile
@sineld
sineld / Ulke.js
Last active April 4, 2023 18:22
Ulke Script based on php
View Ulke.js
const ulke = {
adalet: () => undefined,
ekonomi: () => undefined,
insanHaklari: () => undefined,
basinOzgurlugu: () => undefined,
kadinCinayetleri: () => Number .MAX_SAFE_INTEGER,
sanat: () => undefined, bilim: () => undefined,
komsularlaSorunSayisi: () => Number.MAX_SAFE_INTEGER,
dolardanEndiselenenVarsa: () => "Birincisi sunu soriyim size. Dolarla mi maas altyorsunuz. Dolar borcunuz mu var? Dolarla bir isiniz mi var?"
cinsiyetAyrimi: () => true,
@sineld
sineld / db.php
Created April 3, 2023 21:27
Laravel Query Builder Bindings Date Where In Php Array
View db.php
<?php
$dates = ['2023-03', '2023-04', '2023-05'];
$binds = implode(',', array_fill(0, count($dates), '?'));
$users = Illuminate\Support\Facades\DB::select(
"SELECT * FROM users WHERE DATE_FORMAT(created_date, '%Y-%m') IN ({$binds})",
$dates
);
@sineld
sineld / select_lang.php
Created July 6, 2013 05:14
Localisation gone wrong?
View select_lang.php
<?php
// http://forums.laravel.io/viewtopic.php?pid=45912#p45912
First of all, thank you for asking this question, looking into it made me understand things a lot better. As it turns out, you can also use parameters for prefixes in route groups. Using a filter, you can then obtain the value of all parameters (so including the prefix of the route group). What you'll want to do is create a filter (best put in filters.php):
[code]
Route::filter('select_lang', function($route)
{
// do check that the lang parameter is valid!
App:setLocale($route->getParameter('lang'));
});
[/code]
View global.php
<?php
// app/start/global.php
/*
|--------------------------------------------------------------------------
| Application Error Logger
|--------------------------------------------------------------------------
|
| Here we will configure the error logger setup for the application which
@sineld
sineld / _verify-repair-permissions-disk.md
Created August 14, 2018 10:00 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)
View _verify-repair-permissions-disk.md
@sineld
sineld / awesome-php.md
Created September 19, 2012 15:49 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
View awesome-php.md
@sineld
sineld / cloudSettings
Last active January 22, 2022 18:11 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
View cloudSettings
{"lastUpload":"2022-01-22T18:11:17.053Z","extensionVersion":"v3.4.3"}
@sineld
sineld / ip.ssh
Created May 13, 2013 07:42
ubuntu static ip
View ip.ssh
sudo nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo eth0
iface lo inet loopback
# The primary network interface
View batch_image_resize.sh
#!/bin/bash
# This script resizes all the images it finds in a folder (and its subfolders) and resizes them
# The resized image is placed in the /resized folder which will reside in the same directory as the image
#
# chmod +x batch_resize.sh
# Usage: > ./batch_resize.sh
# or run:
# sips -Z 600 *.jpg
initial_folder="/your/images/folder" # You can use "." to target the folder in which you are running the script for example
View awesome-php.md