Skip to content

Instantly share code, notes, and snippets.

View SamadiPour's full-sized avatar
❤️
Love Coding

Amir Hossein SamadiPour

❤️
Love Coding
View GitHub Profile
@SamadiPour
SamadiPour / InputTester.java
Last active April 28, 2019 16:03
Benchmark of different I/O in java
package TA_Class;
import java.io.*;
import java.time.Duration;
import java.time.Instant;
import java.util.InputMismatchException;
import java.util.Random;
import java.util.Scanner;
import java.util.StringTokenizer;
@SamadiPour
SamadiPour / sc_vs_di.py
Last active April 18, 2020 13:52
Compare str_convert and split with divide
import cProfile
# https://quera.ir/problemset/contest/3539/%D8%B3%D8%A4%D8%A7%D9%84-%D8%AA%DA%A9%D8%B1%D9%82%D9%85%DB%8C
def convert_to_string(number: int):
for i in range(10_000_000): # loop 10_000_000 times
array = list(str(number))
# number_sum = 0
@SamadiPour
SamadiPour / main.dart
Created December 24, 2020 14:40 — forked from imaNNeo/main.dart
import 'dart:async';
import 'dart:math' as math;
import 'dart:ui';
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
import os
import urllib.request
import shutil
import json
import sys
# variables
servers_url = "https://api.nordvpn.com/v1/servers?filters\[servers_technologies\]\[identifier\]=wireguard_udp&limit=999999"
folder_dir = 'wireguard_configs/'
@SamadiPour
SamadiPour / create_token_bash.sh
Last active June 5, 2022 19:06
Flutter Automated iOS Deployment
#!/bin/bash
issuer_id="9f4xxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
key_id="2F9XXXXXXX"
key_path="./private_keys/AuthKey_2F9XXXXXXX.p8"
expiration_time=$(date -v +60S +%s)
function base64_urlsafe {
base64 | tr -d '\r\n=' | tr '+/' '-_'
}
@SamadiPour
SamadiPour / snappfood.js
Last active January 8, 2024 09:37
Snappfood Spent money
cookies = Object.fromEntries(document.cookie.split('; ').map(c => c.split('=')));
let UDID = cookies.UDID;
let jwt = cookies[['jwt-access_token']] ?? JSON.parse(window.localStorage.JWT ?? '{}').access_token;
var myHeaders = new Headers();
myHeaders.append("authority", "snappfood.ir");
myHeaders.append("accept", "application/json, text/plain, */*");
myHeaders.append("accept-language", "en-US,en;q=0.9,fa;q=0.8");
myHeaders.append("authorization", "Bearer " + jwt);
myHeaders.append("content-type", "application/x-www-form-urlencoded");
@SamadiPour
SamadiPour / bonbast.sh
Created July 8, 2022 21:21
Bonbast Raycast
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title bonbast
# @raycast.mode inline
# @raycast.refreshTime 3h
# Optional parameters:
# @raycast.icon 💰
@SamadiPour
SamadiPour / main.py
Created July 31, 2022 22:30
Twitter user likes and retweets (BlockList)
import tweepy
import os
import json
client = tweepy.Client(
'TWITTER_KEY',
wait_on_rate_limit=True
)
user_response = client.get_user(username='TWITTER_USERNAME')
@SamadiPour
SamadiPour / init.ipynb
Last active July 31, 2022 22:55
Deepnote selenium example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SamadiPour
SamadiPour / flight-checker.py
Last active April 24, 2023 17:56
Alibaba.ir - Check if flight is available and alert in telegram
import hashlib
import os
import requests
# ============== Variables ==============
url = "https://ws.alibaba.ir/api/v1/flights/domestic/available/"
telegram_token = "" # os.environ["TOKEN"]
chat_id = "" # os.environ["CHAT_ID"]
searches = [