Skip to content

Instantly share code, notes, and snippets.

View jnbn's full-sized avatar

Ugur Aydogdu jnbn

View GitHub Profile
@jnbn
jnbn / .php-cs-fixer.php
Created December 6, 2021 20:30
Laravel .php-cs-fixer.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'no_unused_imports' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'binary_operator_spaces' => [
@jnbn
jnbn / imagick3.4.4-PHP7.2-forge.sh
Last active August 27, 2019 12:44 — forked from danielstgt/imagick3.4.3-PHP7.3-forge.sh
Install Imagick 3.4.4 on PHP 7.2 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.4.tgz
tar xvzf imagick-3.4.4.tgz
@jnbn
jnbn / PNGWhiteTrim.py
Last active January 22, 2018 20:08 — forked from thomastweets/PNGWhiteTrim.py
Python script to trim all png images with white background in a folder
from PIL import Image
import sys
import glob
# Trim all png images with alpha in a folder
# Usage "python PNGAlphaTrim.py ../someFolder"
try:
folderName = sys.argv[1]
except :
@jnbn
jnbn / controller.php
Last active May 28, 2023 08:37
Replicate (Duplicate) Eloquent Model With Relations
<?php
public function replicateWithRelations(QuestionCategory $questioncategory)
{
$newCategory = $questioncategory->replicate();
$newCategory->name = "Kopyası: ".$questioncategory->name;
$newCategory->push();
$questioncategory->relations = [];
//load relations on EXISTING MODEL
var geojson = [
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
@jnbn
jnbn / gist:8f8cb6cbf5fe1bcbc82c
Created March 22, 2015 16:08
jnbn's Sublime Keys
[
{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" },
{ "keys": ["super+shift+r"], "command": "reindent" },
{ "keys": ["alt+tab"], "command": "unindent" }
]
@jnbn
jnbn / gist:24cba75c23ba50d591c6
Created March 22, 2015 16:08
jnbn's Sublime Settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"fade_fold_buttons": false,
"find_selected_text": true,
"fold_buttons": true,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
@jnbn
jnbn / iller-array.php
Last active October 29, 2023 15:52
Türkiye Iller Array
<?php
$iller = array('','Adana', 'Adıyaman', 'Afyon', 'Ağrı', 'Amasya', 'Ankara', 'Antalya', 'Artvin',
'Aydın', 'Balıkesir', 'Bilecik', 'Bingöl', 'Bitlis', 'Bolu', 'Burdur', 'Bursa', 'Çanakkale',
'Çankırı', 'Çorum', 'Denizli', 'Diyarbakır', 'Edirne', 'Elazığ', 'Erzincan', 'Erzurum', 'Eskişehir',
'Gaziantep', 'Giresun', 'Gümüşhane', 'Hakkari', 'Hatay', 'Isparta', 'Mersin', 'İstanbul', 'İzmir',
'Kars', 'Kastamonu', 'Kayseri', 'Kırklareli', 'Kırşehir', 'Kocaeli', 'Konya', 'Kütahya', 'Malatya',
'Manisa', 'Kahramanmaraş', 'Mardin', 'Muğla', 'Muş', 'Nevşehir', 'Niğde', 'Ordu', 'Rize', 'Sakarya',
'Samsun', 'Siirt', 'Sinop', 'Sivas', 'Tekirdağ', 'Tokat', 'Trabzon', 'Tunceli', 'Şanlıurfa', 'Uşak',
'Van', 'Yozgat', 'Zonguldak', 'Aksaray', 'Bayburt', 'Karaman', 'Kırıkkale', 'Batman', 'Şırnak',