Skip to content

Instantly share code, notes, and snippets.

View swdevbali's full-sized avatar
:octocat:
Bringing back my golden era of programming! Wohoo!

Eko Suprapto Wibowo swdevbali

:octocat:
Bringing back my golden era of programming! Wohoo!
View GitHub Profile
'use client';
import { useState, useEffect, Suspense } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import {
Building2,
Rocket,
Users,
Video,
ArrowRight,
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'
import { createServerClient as createSupabaseServerClient } from '@supabase/ssr'
// Rate limiting map (in production, use Redis or similar)
const rateLimitMap = new Map<string, { count: number; resetTime: number }>()
export async function middleware(request: NextRequest) {
// Rate limiting
const clientId = request.ip || request.headers.get('x-forwarded-for') || 'unknown'
'use client'
import { useState, useRef, useEffect } from 'react'
import {
Layout,
LayoutElement,
ContentType,
Resolution,
STANDARD_RESOLUTIONS,
DragState,
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Quote Explorer</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
console.log("Script started");
let quotesArray = [
{
"quote": "Banyak bicara, banyak bekerja",
"author": "Bung Karno"
},
{
"quote": "Habis gelap terbitlah terang",
"author": "R.A Kartini"
import pandas as pd
import base64
# Buat DataFrame kosong
df = pd.DataFrame(columns=['Image'])
# Contoh gambar-gambar dengan "5 digit letter-number sequence"
gambar1 = 'abcde.png'
gambar2 = 'fghij.png'
@swdevbali
swdevbali / login.py
Created October 18, 2023 01:26
Kode login
import scrapy
from bs4 import BeautifulSoup
class MySpider(scrapy.Spider):
name = 'my_spider'
start_urls = ['https://example.com']
def parse(self, response):
# Parse the HTML content with BeautifulSoup
soup = BeautifulSoup(response.text, 'html.parser')
# regex_soup.py
import re
from urllib.request import urlopen
url = "http://olympus.realpython.org/profiles/dionysus"
page = urlopen(url)
html = page.read().decode("utf-8")
pattern = "<title.*?>.*?</title.*?>"
@swdevbali
swdevbali / hello.py
Created December 20, 2022 16:53
Kode Python
print("Hello World!")
@swdevbali
swdevbali / Profit Dividen.csv
Created August 15, 2022 01:54
Berapa profit dividen-mu jika membeli saham BBCA di tahun 2022?
Jumlah Saham Dibeli Harga Persaham Biaya Pembelian Profit Dividen / Lembar Saham Total Profit (pertahun) Total Profit (perbulan)
633005 Rp. 8061 Rp. 5.102.495.054 Rp. 120 Rp. 75.960.600 Rp. 6.330.050
1861 Rp. 8061 Rp. 15.001.056 Rp. 120 Rp. 223.320 Rp. 18.610