Skip to content

Instantly share code, notes, and snippets.

View Pedroxam's full-sized avatar
🎯
Available

Pedram Pedroxam

🎯
Available
  • Turkey, Istanbul
View GitHub Profile
@Pedroxam
Pedroxam / gist:2a474718f4ecd253186500133c553ac9
Created November 14, 2023 16:34
An easy way to use values in redis
const Redis = require("ioredis");
const _ = require("lodash");
const redis = new Redis({
port: 6379, // Redis port
host: 'HOST, // Redis host
username: "",
password: "",
db: 0,
});
@Pedroxam
Pedroxam / gist:2eaf6c7c36ebd10946f4921c7d97d480
Last active May 27, 2019 04:32
Simple Customer and Api Protector - PHP
<?php
//Step One -> Define Your Product Name
$product = 'Simple';
//Step One -> Define Your Customers List
$customers = [
'Username-01',
@Pedroxam
Pedroxam / gist:c0cae5f3baa225f563915318c780865b
Created March 16, 2019 12:51
PHP tag and Parse Template
/*
PHP 7.3
Usage:
Create file eg: home.html, put this tag {$string}
*/
function template($html)
{
global $tmpl;
global $language;
@Pedroxam
Pedroxam / gist:aae11c880e8a3b2f6a1fe2fe6677106f
Created February 11, 2019 16:26
Return Client Country Code
<?php
function getCountry()
{
if (isset($_SERVER['HTTP_CF_IPCOUNTRY'])) {
$country = $_SERVER['HTTP_CF_IPCOUNTRY'];
} else {
$country = "unknown";
}
return $country;