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
function kutt | |
set API "5deD1GnnzAvAcp5updIjNvbnolj7jkEiI6~yi" | |
set mainDomain "https://69b.ir/" | |
set URL $mainDomain"api/v2/links" | |
set date (date "+%N") | |
set custom (string sub -l 6 $date) | |
if test $argv[2] | |
set custom $argv[2] | |
end | |
set newUrl $mainDomain$custom |
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
#!/usr/bin/env python3 | |
import concurrent.futures | |
import logging | |
import re | |
from sys import argv | |
if '-v' in argv: | |
logging.basicConfig(level=logging.DEBUG) | |
else: | |
logging.basicConfig(level=logging.INFO) |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler, StringRegexHandler, BaseFilter) | |
from telegram import MessageEntity | |
import logging | |
group_admins = {} | |
# Enable logging | |
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', | |
level=logging.INFO) |
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 | |
$a = "9133917225"; | |
$mobile_pattern = "/^(\s)*(\+98|0098|98|0)?(9\d{9})(\s*|$)/"; | |
preg_match($mobile_pattern,$a,$matches); | |
if(sizeof($matches) === 5) | |
var_dump($matches[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 django_filters | |
from django.contrib.auth.models import User | |
from django.contrib.contenttypes.models import ContentType | |
from rest_framework import status | |
from rest_framework.generics import GenericAPIView | |
from rest_framework.mixins import ListModelMixin, RetrieveModelMixin, CreateModelMixin, DestroyModelMixin, \ | |
UpdateModelMixin | |
from rest_framework.request import Request | |
from rest_framework.response import Response |
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
#alias login "curl 'http://devapp01.icico.net.ir/oauth/token' -s -H 'Authorization: Basic U2FsZXM6cGFzc3dvcmQ=' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=password&username=saeb&password=password'|jq '.access_token'" | |
#alias auth2 "echo \"Authorization: Bearer \" ( string replace -a '\"' '' (login))" | |
function nicico | |
set login (curl 'http://devapp01.icico.net.ir/oauth/token' -s -H 'Authorization: Basic U2FsZXM6cGFzc3dvcmQ=' -H 'Content-Type: application/x-www-form-urlencoded' --data 'grant_type=password&username=saeb&password=password'|jq '.access_token') | |
set auth2 (echo "Authorization: Bearer " ( string replace -a '"' '' $login)) | |
# echo $login $auth2 | |
curl -s -H $auth2 $argv | |
end |
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
{ | |
load_plugin_textdomain('gflimitbyday', | |
false, | |
basename(dirname(__FILE__)) . '/languages'); | |
} | |
add_action('init','gflimitbyday_add_languages'); |
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
ip a|awk '{if ($1 ~ /^[0-9]:/) print $1 ; if (/inet/) print $2}' | |
1: | |
127.0.0.1/8 | |
::1/128 | |
2: | |
172.16.6.164/24 | |
fe80::681a:78de:211:28d2/64 | |
3: | |
192.168.122.1/24 | |
4: |
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
public static void getUserName(String xlsLocation) throws IOException { | |
FileInputStream file = new FileInputStream( new File(xlsLocation)); | |
Workbook workbook = new XSSFWorkbook(file); | |
Sheet sheet = workbook.getSheetAt(0); | |
for(Row row: sheet) | |
{ | |
Cell tenCell = row.getCell(0); | |
tenCell.setCellType(CellType.STRING); | |
Cell sixCell = row.getCell(1); | |
sixCell.setCellType(CellType.STRING); |
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
from openpyxl import load_workbook | |
from openpyxl.worksheet.worksheet import Worksheet | |
from requests import get | |
xlsxFileAddress = "/home/saeb/PycharmProjects/SendSMS/xlsx/139804.xlsx" #xlsx file | |
def sendToSMSCenter(phone="09133917225", text="سلام دنیا"): | |
params = { | |
"from": "+98100020400", |