Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ahmet Imamoglu ahmeti

🎯
Focusing
View GitHub Profile
View 01-ubuntu.sh
# 01. Sanal Bellek Oluşturma ve Başlatma
cd /var
touch swapfile
chmod 600 swapfile
/bin/dd if=/dev/zero of=/var/swapfile bs=1M count=10000
/sbin/mkswap /var/swapfile
/sbin/swapon /var/swapfile
View 01-php-excel-export.php
<?php
function exportExcel($filename='ExportExcel', $columns=array(), $data=array(), $replaceDotCol=array()){
header('Content-Encoding: UTF-8');
header('Content-Type: text/plain; charset=utf-8');
header("Content-disposition: attachment; filename=".$filename.".xls");
echo "\xEF\xBB\xBF"; // UTF-8 BOM
@ahmeti
ahmeti / 01-redis.sh
Last active Apr 18, 2021
Redis İşlemleri
View 01-redis.sh
redis-cli> INFO keyspace
# Keyspace
db0:keys=7,expires=0,avg_ttl=0
db1:keys=1,expires=0,avg_ttl=0
db2:keys=1,expires=0,avg_ttl=0
db11:keys=1,expires=0,avg_ttl=0
View 01-node-app.js
const fs = require('fs');
const https = require('https');
const WebSocket = require('ws');
const server = https.createServer({
cert: fs.readFileSync('/home/user/certificates/test.com.crt'), // Domain SSL Certificate
key: fs.readFileSync('/home/user/certificates/test.com.key'), // Domain SSL Private Key
});
const wss = new WebSocket.Server({ server });
@ahmeti
ahmeti / 1-laravel_index.php
Created May 28, 2020
Laravel Index & Register Shutdown Function
View 1-laravel_index.php
<?php
function shutdown(){
$includedFiles = print_r(get_included_files(), true);
\Log::info($includedFiles);
}
register_shutdown_function('shutdown');
/**
View tricks.php
<?php
# Multiple SPF Records Yandex and Mailgun
v=spf1 include:mailgun.org include:_spf.yandex.net ~all
# PHP ini
max_execution_time = 90
max_input_time = 90
memory_limit = 1024M
post_max_size = 20M
@ahmeti
ahmeti / DefaultValueBinder.php
Last active Dec 4, 2019
Fix PHP Excel for PHP v7.4
View DefaultValueBinder.php
<?php
// ...
// Location: /phpoffice/phpexcel/Classes/PHPExcel/Cell/DefaultValueBinder.php
/**
* DataType for value
*
* @param mixed $pValue
* @return string
@ahmeti
ahmeti / 1-apache-remove.sh
Last active Jul 28, 2019
Amazon AWS üzerinde Ubuntu 18.04, Nginx, Php 7.2, Mysql 8 Kurulumu
View 1-apache-remove.sh
sudo service apache2 stop
sudo apt-get purge apache2*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2
View Postgresql-1.sql
CREATE DATABASE test_db ENCODING='UTF-8' LC_COLLATE='tr_TR.UTF-8' TEMPLATE=template0;