This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
color 0E | |
title MySQL backup. | |
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" | |
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" | |
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%" & set "MS=%dt:~15,3%" | |
set "dirname=%DD%_%MM%_%YY%_%HH%%Min%" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('max_execution_time', 120);//2 minutes | |
error_reporting(0); | |
$api_key = '';//Your YouTube/Google api key | |
$your_ch_id = '';//YOur YouTube channel id | |
function call_api($call, $type) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $call); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GAMENUMBER_HOME_AWAY | |
1_LAC_DEN | |
2_LAC_OKC | |
3_LAC_HOU | |
4_NOP_LAC | |
5_HOU_LAC | |
6_LAC_WAS | |
7_OKC_LAC | |
8_PHI_LAC | |
9_ORL_LAC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (isset($_GET['page'])) { | |
$page = $_GET['page'];//If ?page= is set use it | |
} else { | |
$page = 0;//No ?page= found so we are at page 1 which is a zero | |
} | |
$db = new PDO('mysql:host=localhost;dbname=DATABASE;charset=utf8mb4', 'USERNAME', 'PASSWORD'); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
function pagination_system($page_number, $items_per_page) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_date_dir($start_dir = ''){ | |
$year = date("Y"); | |
$month = date("m"); | |
$day = date("d"); | |
$directory = "".$start_dir."$year/$month/$day/"; | |
if(!is_dir($directory)){ | |
mkdir($directory, 755, true); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function create_icon($first_letter, $second_letter, $save_as) | |
{ | |
$image = ImageCreate(64, 64) or die ("Error making image");//Make the base image (64 x 64) | |
$background_color = ImageColorAllocate($image, rand(0, 255), rand(0, 255), rand(0, 255));//Base image background color (random) | |
$text_color = ImageColorAllocate($image, 255, 255, 255);//White text for font | |
$font = '/var/www/html/ariel.ttf';//Defined font file | |
if ($second_letter == ''){//Positioning for one vs two letters | |
$string = "$first_letter"; | |
$img = imagettftext($image, 36, 0, 17, 47, $text_color, $font, $string); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
color: #BAD5EE; | |
background-color: #1C2030; | |
font-family: 'Inconsolata', monospace | |
} | |
.site-wrapper { | |
background-color: #1C2030 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class weatherApp | |
{ | |
const URI = 'https://api.openweathermap.org/data/2.5/'; | |
private $api_key; | |
private $data; | |
/** | |
* Sets api key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class corbpieBlogPoster | |
{ | |
private $accessToken; | |
private $tokenType; | |
private $clientId; | |
private $clientSecret; | |
private $authMode = 'basic'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function insert_request() | |
{ | |
$db = new PDO('mysql:host=127.0.0.1;dbname=requests;charset=utf8mb4', 'USERNAME', 'PASSWORD'); | |
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
$referer = NULL; | |
if (isset($_SERVER['HTTP_REFERER'])) { | |
$referer = $_SERVER['HTTP_REFERER']; | |
} | |
$insert = $db->prepare('INSERT IGNORE INTO `data` (`ip`, `referer`, `method`, `user_agent`, `code`, `dir`, `time`) VALUES (?,?,?,?,?,?,?)'); |
OlderNewer