Skip to content

Instantly share code, notes, and snippets.

View bethropolis's full-sized avatar
😊

Bethuel bethropolis

😊
View GitHub Profile
[
{
"id": 1,
"name": "Item 1",
"previewUrl": "https://fastly.picsum.photos/id/123/200/300.jpg?hmac=uMA4z26tAYQnhW8_XlH0SoULB5z9s8tan-WCDkzbdMs"
},
{
"id": 2,
"name": "Item 2",
"previewUrl": "https://fastly.picsum.photos/id/123/200/300.jpg?hmac=uMA4z26tAYQnhW8_XlH0SoULB5z9s8tan-WCDkzbdMs"
@bethropolis
bethropolis / test.js
Last active March 7, 2024 06:24
judul ishura
// HTML snippet
const htmlSnippet = `
<div class="infozingle">
<p>
<span>
<b>Judul</b>: Ishura
</span>
</p>
</div>
`;
@bethropolis
bethropolis / main.go
Created December 19, 2023 00:01
take a sceenshot of the websites under is-a.dev domain
package main
import (
"context"
"encoding/json"
"log"
"os"
"path/filepath"
"runtime"
"sync"
import json
import random;
import os
folder_name = "Playlist"
tracks=os.listdir(folder_name)
while True:
songName = input("\n\nEnter the song or artist name(Enter q to quit): ").lower()
@bethropolis
bethropolis / song_recomendation.py
Last active October 27, 2023 19:32
a python program for getting song recommendation from a playlist.
import json
import random
playlists=["trap","hiphop"]
query = input("Enter song name or artist name: ").lower()
def load_songs(file):
file_path = file + ".json"
with open(file_path) as f:
songs = json.load(f)
@bethropolis
bethropolis / main.go
Last active October 27, 2023 08:03
a program for getting artist and songs from spotify playlist
package main
import (
"bufio"
"encoding/json"
"fmt"
"net/http"
"os"
"strings"
)
@bethropolis
bethropolis / todo-app.go
Created September 28, 2023 03:34
a todo app written in go with menu, list, add and remove features
package main
import (
"bufio"
"fmt"
"io"
"os"
"strings"
"time"
)
@bethropolis
bethropolis / file-structure.py
Created August 1, 2023 07:28
a python script for automatically creating file structure of any directory.
import os
import fnmatch
# Define the root directory
root_dir = os.getcwd()
# Define the output file name
output_file = "directory_structure.txt"
# Define patterns to ignore
@bethropolis
bethropolis / installer-script.php
Created July 23, 2023 22:26
suplike installer
<?php
function downloadFile($url, $destination)
{
$fileContents = @file_get_contents($url);
if ($fileContents === false) {
die("Error: Failed to download the file from $url");
}
$result = file_put_contents($destination, $fileContents);
if ($result === false) {
@bethropolis
bethropolis / rateLimit.php
Created July 19, 2023 05:43
RateLimiter class handles rate limiting of requests based on user roles and uses session storage.
<?php
class RateLimiter {
private $timePeriod;
private $maxRequests;
private $retryAfter;
private $sessionKey;
private $errorRedirectUrl;
private $userRolesLimits;