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 November 7, 2024 19:19
Ulke Script based on php
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
<?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 / cloudSettings
Last active January 22, 2022 18:11 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Coding Style Ruleset
{"lastUpload":"2022-01-22T18:11:17.053Z","extensionVersion":"v3.4.3"}
#!/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
@sineld
sineld / media-query.css
Created November 26, 2019 13:02 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
//CSS
@sineld
sineld / valet.conf
Created April 13, 2019 23:54 — forked from poul-kg/valet.conf
CORS Rules for Laravel Valet Nginx
# To enable CORS you should add lines with CORS rules below to your valet.conf file
# Find the file /usr/local/etc/nginx/valet/valet.conf - this is Valet conf for Nginx
# of try to execute `locate valet.conf` and find the `valet.coinf` in `nginx` subdirectory
# after you edit your valet.conf do not forget to execute `valet restart`
server {
listen 80 default_server;
root /;
charset utf-8;
client_max_body_size 128M;
@sineld
sineld / url_slug.js
Created December 25, 2018 14:13 — forked from sgmurphy/url_slug.js
URL Slugs in Javascript (with UTF-8 and Transliteration Support)
/**
* Create a web friendly URL slug from a string.
*
* Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support.
*
* Although supported, transliteration is discouraged because
* 1) most web browsers support UTF-8 characters in URLs
* 2) transliteration causes a loss of information
*
* @author Sean Murphy <sean@iamseanmurphy.com>
@sineld
sineld / add-option-to-dropdown.js
Created October 16, 2018 12:02 — forked from paulund/add-option-to-dropdown.js
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');
@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)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

<?php
$progressBar = $this->output->createProgressBar(count($users));
$progressBar->setEmptyBarCharacter(' ');
$progressBar->setProgressCharacter('>');
$progressBar->setBarCharacter('-');
$progressBar->start();
foreach ($users as $user) {
$this->performTask($user);