Skip to content

Instantly share code, notes, and snippets.

View eburhan's full-sized avatar
🎯
Focusing

Erhan BURHAN eburhan

🎯
Focusing
  • T.C. İçişleri Bakanlığı
  • Ankara
  • X @eburhan
View GitHub Profile
@eburhan
eburhan / Calendar.php
Created January 4, 2016 19:13
Herhangi bir yılın Herhangi bir ayının günlerini, haftalara bölünmüş halde takvim olarak geri döndürür.
<?php
/**
* Herhangi bir yılın herhangi bir ayına ait günlerini,
* haftalara bölünmüş halde takvim olarak geri döndürür.
* 2016 Erhan BURHAN
*/
class Calendar {
/**
* takvimi oluşturur
@eburhan
eburhan / innobackupex-restore.sh
Created March 1, 2016 14:35 — forked from dalecaru/innobackupex-restore.sh
Scripts to create and restore full and incremental backups (for all databases on server) using innobackupex from Percona.
#!/bin/sh
#
# Script to prepare and restore full and incremental backups created with innobackupex-runner.
#
# This script is provided as-is; no liability can be accepted for use.
#
INNOBACKUPEX=innobackupex-1.5.1
INNOBACKUPEXFULL=/usr/bin/$INNOBACKUPEX
TMPFILE="/tmp/innobackupex-restore.$$.tmp"
@eburhan
eburhan / server.blacklist
Created February 19, 2018 07:29 — forked from peterjaap/server.blacklist
Bad bot blacklist nginx config file (used on Hypernodes for Magento - place in /data/web/nginx/server.blacklist)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|DISCo|discobot|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearch|ExpertSearchSpider|Express\ WebPictures|extract|ExtractorPro|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|genieo|Genieo|GetRight|GetWeb\!|GigablastOpenSource|Go\-Ahead\-Got\-It|Go\!Zilla|GozaikBot|grab|GrabNet|Grafula|GrapeshotCrawler|GT\:\:WWW|GTB5|Guzz
@eburhan
eburhan / nginx-socketio-ssl-reverse-proxy.conf
Created February 14, 2020 08:39 — forked from gmanau/nginx-socketio-ssl-reverse-proxy.conf
How to setup nginx as nodejs/socket.io reverse proxy over SSL
upstream upstream-apache2 {
server 127.0.0.1:8080;
}
upstream upstream-nodejs {
server 127.0.0.1:3000;
}
server {
listen 80;
@eburhan
eburhan / phpserver.bat
Created April 2, 2020 10:26
start a PHP Web Server from context menu
@echo off
SET "Host=localhost"
SET "Port=88"
SET /p "Port=Port numarasi gir ya da [ENTER] ile %Port% nolu portu otomatik sec: "
START http://%Host%:%Port%
php -S %Host%:%Port% -t "%1"
@eburhan
eburhan / config.md
Created January 3, 2023 14:07 — forked from eneajaho/config.md
Angular ESLint & Prettier Configuration

Install Angular ESLint

ng add @angular-eslint/schematics

Install Prettier and Prettier-ESLint dependencies

npm install prettier prettier-eslint eslint-config-prettier eslint-plugin-prettier --save-dev

ESLint configuration

Filename: .eslintrc.json

@eburhan
eburhan / getToken.js
Last active June 8, 2023 14:00
Pre-request script for POSTMAN
// JWT Token icerisinden istedigimiz bolumu almak icin
function getTokenPart(token, part) {
const base64Url = token.split('.')[part];
const words = CryptoJS.enc.Base64.parse(base64Url);
const jsonPayload = CryptoJS.enc.Utf8.stringify(words);
return JSON.parse(jsonPayload);
};
// Token sona erme zamanini Turkce olarak geri dondurur
function getTokenExpired(token) {
@eburhan
eburhan / tcno_dogrula.js
Last active April 4, 2024 17:16
javascript ile TC Kimlik Numarası doğrulama (1 döngü kullanılarak)
/* tc kimlik numarasının geçerli olup olmadığını kontrol eder
* 2015 Erhan BURHAN
*--------------------------------------------------------------------*/
function tcno_dogrula(tcno)
{
// geleni her zaman String'e çevirelim!
tcno = String(tcno);
// tcno '0' karakteri ile başlayamaz!
if (tcno.substring(0, 1) === '0') {