Skip to content

Instantly share code, notes, and snippets.

View sercanarga's full-sized avatar

Sercan Arğa sercanarga

View GitHub Profile
@sercanarga
sercanarga / ArgaMailer.php
Created December 7, 2023 18:14
smtp mail class
<?php
/**
* ArgaMailer Class
*
* Usage:
* $mailer = new ArgaMailer('smtp.server.com', 587, 'username', 'password');
* $mailer->connect();
* $mailer->login();
* $mailer->sendMail('from@example.com', 'to@example.com', 'Subject', 'Message');
@sercanarga
sercanarga / wisecp.php
Last active June 22, 2023 11:40
wisecp
<?php
public function clientArea() {
$content = $this->clientArea_buttons_output();
$_page = $this->page;
if (!$_page) $_page = 'home';
$content .= $this->get_page('clientArea-' . $_page, ['test1' => 'hello world', 'test2' => 'sample var']);
return $content;
}
@sercanarga
sercanarga / function.php
Created December 14, 2018 14:06
PHP CURL Youtube Video Watch Count Function
<?php
function video_count($v) {
$ch = curl_init();
$v = 'https://www.youtube.com/watch?v='.$v;
curl_setopt($ch, CURLOPT_URL, $v);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$v = curl_exec($ch);
curl_close($ch);
preg_match_all('@<div class="watch-view-count">(.*?)</div>@si',$v, $c);
$c = implode($c[1]);
@sercanarga
sercanarga / sinif.php
Last active November 10, 2018 19:41
Miladi Tarihi Hicri Tarihe Çevirme Sınıfı
<?php
class Hicri {
private $hicri;
public function __construct($tarih = false) {
if(!$tarih) $tarih = time();
$this->hicri = $this->donustur($tarih);
}
public function hici_aylar($i) {
static $ay = array("Muharrem", "Safer", "Rebiü’l-Evvel", "Rebiü’l-Ahir", "Cemaziye’l-Evvel", "Cemaziye’l-Ahir", "Recep", "Şaban", "Ramazan", "Sevval", "Zi’l-ka’de", "Zi’l-Hicce");
return $ay[$i-1];
<?php
function gercekIP() {
if(getenv("HTTP_CLIENT_IP")) {
$ip = getenv("HTTP_CLIENT_IP");
} elseif(getenv("HTTP_X_FORWARDED_FOR")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
if (strstr($ip, ',')) {
$bol = explode (',', $ip);
$ip = trim($bol[0]);
}
// ==UserScript==
// @name Agar.IO
// @namespace Agar.IO
// @version 1.0
// @description Agar.IO Script
// @author Sercan Arğa
// @match http://agar.io/
// @grant none
// ==/UserScript==