Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Ahmet Imamoglu ahmeti

🎯
Focusing
View GitHub Profile
@ahmeti
ahmeti / HtmlTableGenerator.html
Created Jun 15, 2022
HTML Table Generator (Especially Mac Mail)
View HtmlTableGenerator.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML Table Generator (Especially Mac Mail)</title>
</head>
@ahmeti
ahmeti / backup.php
Created Dec 17, 2021
Wordpress Backup With Client Request
View backup.php
<?php
ini_set('max_execution_time', 0);
error_reporting(E_ALL);
ini_set('display_errors','On');
$rootPath = realpath(__DIR__);
$zip = new ZipArchive();
$zip->open('backup_'.uniqid().'.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE);
View apple_store.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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