Skip to content

Instantly share code, notes, and snippets.

View ahmeti's full-sized avatar
🎯
Focusing

Ahmet Imamoglu ahmeti

🎯
Focusing
View GitHub Profile
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 15:28
Laravel Index & Register Shutdown Function
<?php
function shutdown(){
$includedFiles = print_r(get_included_files(), true);
\Log::info($includedFiles);
}
register_shutdown_function('shutdown');
/**
@ahmeti
ahmeti / tricks.php
Last active April 18, 2020 17:02
Tricks
<?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 December 4, 2019 16:31
Fix PHP Excel for PHP v7.4
<?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 July 28, 2019 11:50
Amazon AWS üzerinde Ubuntu 18.04, Nginx, Php 7.2, Mysql 8 Kurulumu
sudo service apache2 stop
sudo apt-get purge apache2*
sudo apt-get autoremove
whereis apache2
sudo rm -rf /etc/apache2
CREATE DATABASE test_db ENCODING='UTF-8' LC_COLLATE='tr_TR.UTF-8' TEMPLATE=template0;
''' Hücreye ait yorum bilgisini döndürür.
''' Örnek Kullanım; =getComment(A2)
'''
Function getComment(xCell As Range) As String
On Error Resume Next
getComment = xCell.Comment.Text
End Function
<?php
function mail_utf8($from,$from_name,$to,$adi,$subject,$body=''){
// Konu
$subject = "=?UTF-8?B?".base64_encode(urldecode($subject))."?=";
// Header bilgisi
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";