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
def my_arg_function(*args): | |
for arg in args: | |
print(arg) | |
my_arg_function("Hassan", "Raza", "Dev") | |
#output | |
# Hassan | |
# Raza |
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
import imaplib | |
import pprint | |
import os | |
import base64 | |
import email | |
import pandas as pd | |
import time | |
#List of suppliers that have their own folder | |
supplierlist = ["OSG", "SGS", "SECO", "YMW", "SGS2"] |
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
WITH RECURSIVE my_cte AS | |
( | |
SELECT provider_id, count(*) as correct_answers from obs_provider_answers | |
where is_correct = 1 | |
group by provider_id | |
having correct_answers = 4 | |
) | |
select * from obs_provider where provider_id in(SELECT my_cte.provider_id FROM my_cte) and status = 3 |
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
import pickle | |
import sys | |
import re | |
import requests | |
import json | |
from datetime import datetime, timedelta | |
from dateutil import parser | |
import os | |
import os.path | |
import socket |
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 | |
namespace App; | |
use DB; | |
use Storage; | |
use phpseclib\Net\SFTP; | |
use phpseclib\Crypt\RSA; | |
class UploadFile { |
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 | |
namespace App\Console; | |
use Illuminate\Console\Scheduling\Schedule; | |
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | |
use Carbon\Carbon; | |
use Illuminate\Support\Facades\Mail; | |
use DB; | |
// Cron Expression | |
use Cron\CronExpression; |
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 bootstrap($app) | |
{ | |
Yii::$app->on('afterRequest', function($event) { | |
$event->sender->request->headers ; | |
try{ | |
Yii::$app->db->createCommand()->insert('untitled_table', [ |
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 | |
$allContent = "Fantastic hotel in the central of Dublin. Rooms are a bit on the small side, but very modern and well planned. You have a small fully equipped kitchen area, which is good stay for more than a few days. There is also a small barcoffee shop in the lobby with reasonable prices. Very friendly and service minded staff. You have walking distance to Christ Church Cathedral, the Castle, and all pubs and restaurants in the Temple Bar District."; | |
$getChars = array_filter(explode(" ", $allContent)); | |
$getChars = array_map(function ($item){ | |
return strtolower($item); | |
}, $getChars); | |
$profaneWords = [ | |
"i", |
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 Ngrams | |
*/ | |
class Ngrams | |
{ | |
public function 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
/*MODULE PATTERN*/ | |
//create a namespace | |
var shoppingCart = (function() { | |
//private variables | |
var total; | |
var basket = []; | |
//private methods |