Skip to content

Instantly share code, notes, and snippets.

Hafiz Shehbaz Ali hsali

Block or report user

Report or block hsali

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
@hsali
hsali / my.cong
Created Sep 29, 2018
erpnext maria db configuration
View my.cong
#at bottom of my.conf
[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
@hsali
hsali / javascript_scapper.js
Created Jun 7, 2018
convert HTML select element key values to constant property of PHP Class with comments
View javascript_scapper.js
art = document.querySelectorAll("#your-select-element-id-here option");
function tag_g(tag_name, tag_value){
clean_name = tag_name.replace('-'," ");
clean_name = clean_name.replace('&',"AND");
clean_name = clean_name.replace(/\s\s+/g, ' ');
clean_name = clean_name.replace(/[^a-zA-Z ]/g, " ");
tag_slug = clean_name.toUpperCase().split(" ").join("_");
tag_str ="\
/** \n \
View background.js
chrome.webRequest.onHeadersReceived.addListener(
function (details) {
for (var i = 0; i < details.responseHeaders.length; ++i) {
if (details.responseHeaders[i].name.toLowerCase() == 'x-frame-options') {
details.responseHeaders.splice(i, 1);
return {
responseHeaders: details.responseHeaders
};
}
}
@hsali
hsali / hello.py
Created Dec 22, 2017
Python Hello World Application
View hello.py
def hello_function():
print "Hello World"
# This is comment.
# calling function
hello_function()
@hsali
hsali / datatables.php
Created Jul 14, 2017
datables file which is located in config/datatables.php
View datatables.php
<?php
return [
/**
* DataTables search options.
*/
'search' => [
/**
* Smart search will enclose search keyword with wildcard string "%keyword%".
* SQL: column LIKE "%keyword%"
@hsali
hsali / create_subdomain_cpanel.php
Created Mar 24, 2017
PHP Script to create subdomain on cpanel .
View create_subdomain_cpanel.php
function create_subdomain($subDomain,$cPanelUser,$cPanelPass,$rootDomain) {
// $buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain;
$buildRequest = "/frontend/x3/subdomain/doadddomain.html?rootdomain=" . $rootDomain . "&domain=" . $subDomain . "&dir=public_html/subdomains/" . $subDomain;
$openSocket = fsockopen('localhost',2082);
if(!$openSocket) {
return "Socket error";
exit();
View Matlab
#Stop the Mouse event problem
Type in the matlab
!synclient HorizTwoFingerScroll=0
Reference
* http://installfights.blogspot.com/2016/03/fix-mevent-case-in-matlab.html
* https://www.mathworks.com/matlabcentral/answers/112528-mevent-case-when-two-finger-scrolling
@hsali
hsali / active-issues.sql
Created Jan 25, 2017 — forked from alysonla/active-issues.sql
Queries that power the open source section of the 2016 Octoverse report https://octoverse.github.com/
View active-issues.sql
-- Active issues
-- Count of total active issues in the specified time frame
-- Source: githubarchive public data set via Google BigQuery http://githubarchive.org/
SELECT
COUNT(DISTINCT JSON_EXTRACT_SCALAR(events.payload, '$.issue.id')) AS events_issue_count
FROM (SELECT * FROM TABLE_DATE_RANGE([githubarchive:day.],TIMESTAMP('2015-09-01'),TIMESTAMP('2016-08-31')))
AS events
-- 10,723,492 active issues
@hsali
hsali / common.md
Created Nov 21, 2016
common bash usage commands for use
View common.md

Common bash commands

Checking weather

curl wttr.in/Lahore

Play Music

mplayer filename.mp3 or filename.mp4 
@hsali
hsali / mp4mp3.sh
Created Nov 16, 2016
mp4 file conversion to mp3 using ffmpeg commandline utility
View mp4mp3.sh
#!/bin/bash
ffmpeg -i ${1} -f mp3 -ab 192000 -vn ${2}
You can’t perform that action at this time.