Skip to content

Instantly share code, notes, and snippets.

@saeedsajadi
saeedsajadi / mrtehran
Last active September 5, 2023 18:44
MrTehran downloader cli
#!/usr/bin/env python3
import os
import requests
import argparse
from tqdm import tqdm
# Headers for the API request
headers = {
"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/117.0",
@saeedsajadi
saeedsajadi / music_downloader.py
Last active September 5, 2023 08:10
MrTehran playlist Downloader
import os
import requests
from tqdm import tqdm
# Parameters for the API request
params = {
"playlist_id": "1GKM6Q2Bn82Dl0zVZrxew9",
"sort_id": 0,
"page": 1
}
{"lastUpload":"2021-03-11T03:16:37.895Z","extensionVersion":"v3.4.3"}
public static function getStudentsArray()
{
$students = Student::get();
$students->each(function ($model) {
$model->setAppends(['numerator_full_name']);
});
$students = $students->pluck('numerator_full_name', 'id')->toArray();
return $students;
}
<?php
$arr = [
['R1', 'R2', 'R3'],
['A1', 'A2', 'A3'],
['M1', 'M2']
];
$result = [""];
foreach ($arr as $item) {
$tmp = [];
<?php
$arr = [
['R1', 'R2'],
['A1', 'A2', 'A3'],
['M1', 'M2']
];
for ($i = 0; $i < count($arr[0]); $i++){
for ($j = 0; $j < count($arr[1]); $j++) {
for ($k = 0; $k < count($arr[2]); $k++) {
echo $arr[0][$i] . $arr[1][$j] . $arr[2][$k];
<?php
$arrResult = [
'R' => ['1', '2'],
'A' => ['1', '2', '3'],
'M' => ['1', '2'],
];
//R1A1M1
foreach ($arrResult['R'] as $item1){
foreach ($arrResult['A'] as $item2) {