This file contains 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 requests, json | |
# from fake_useragent import UserAgent | |
# user_agent = UserAgent() | |
# random_user_agent = user_agent.random | |
# cookies = { | |
# 'uid': '98390561706a89a0', |
This file contains 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
var h = undefined | |
var u = undefined | |
var n = undefined | |
var t = undefined | |
var e = undefined | |
var r = undefined | |
process.argv.forEach(function (val, index, array) { |
This file contains 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 requests, time | |
from bs4 import BeautifulSoup | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0', | |
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8', | |
'Accept-Language': 'id,en-US;q=0.7,en;q=0.3', | |
'Content-Type': 'application/x-www-form-urlencoded', | |
'Origin': 'https://periksadata.com', | |
'Alt-Used': 'periksadata.com', |
This file contains 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
// Code by Xnuvers007 / Indra Dwi A | |
#include <iostream> | |
#include <cstdlib> | |
#include <ctime> | |
// Fungsi untuk menghasilkan angka heksadesimal 4 digit | |
std::string generateHexDigit() { | |
std::string hexChars = "0123456789ABCDEF"; | |
std::string result; |
This file contains 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 matplotlib.pyplot as plt | |
def fcfs_disk_scheduling(sequence, initial_seek): | |
sequence.insert(0, initial_seek) | |
total_head_movements = 0 | |
head_movements = [initial_seek] | |
for i in range(1, len(sequence)): | |
head_movement = abs(sequence[i] - sequence[i-1]) | |
total_head_movements += head_movement |
This file contains 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 flask import Flask, request, jsonify | |
import requests | |
from bs4 import BeautifulSoup | |
from requests.adapters import HTTPAdapter | |
from urllib3.util.retry import Retry | |
from urllib.parse import urlparse | |
from html import escape | |
app = Flask(__name__) |
This file contains 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 re | |
import requests | |
import tkinter as tk | |
from tkinter import messagebox | |
import webbrowser | |
def get_video_id(url): | |
pattern = re.compile(r'(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=|shorts\/)|youtu\.be\/)([a-zA-Z0-9_-]{11})') | |
match = pattern.search(url) | |
return match.group(1) if match else None |
This file contains 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 flask import Flask, request, jsonify | |
import requests | |
from requests.exceptions import RequestException | |
import time | |
app = Flask(__name__) | |
def normalize_url(url): | |
# Add 'http://' if no scheme is present | |
if not url.startswith(('http://', 'https://')): |
This file contains 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 sys import platform | |
import os | |
import sys | |
import subprocess | |
def is_pip_installed(): | |
try: | |
subprocess.run([sys.executable, "-m", "pip", "--version"], | |
stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=True) |
This file contains 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 fetch from 'node-fetch'; | |
fetch('https://quickcount.kumparan.com/v1/election-result', { | |
method: 'GET', | |
headers: { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:122.0) Gecko/20100101 Firefox/122.0', | |
'Accept': 'application/json, text/plain, */*' | |
} | |
}) | |
.then(response => response.json()) |