Skip to content

Instantly share code, notes, and snippets.

View altugbakan's full-sized avatar

Altuğ Bakan altugbakan

View GitHub Profile
@altugbakan
altugbakan / filter_keys.py
Created August 23, 2023 12:09
Filter i18n JSON Keys in Files
import os
import json
import sys
from typing import Set, Dict, List
def search_keys_in_directory(directory: str, search_keys: Set[str]) -> Set[str]:
used_keys = set()
for root, _, files in os.walk(directory):
if "node_modules" in root or "target" in root:
@altugbakan
altugbakan / check_pokemon.sh
Created November 2, 2023 08:56
Checks out if the Van Gogh Museum's Pokemon shop is up or not.
#!/bin/bash
website="https://www.vangoghmuseumshop.com/en/pokemon"
interval=5 # Time interval in seconds
count=0
target=3
while [ $count -lt $target ]; do
response=$(curl --max-time "$interval" --location --max-redirs 20 "$website" 2>&1)
if [[ "$response" == *"technical difficulties"* ]]; then
@altugbakan
altugbakan / index.ts
Created December 17, 2023 21:41
Processing Multiple Observables
import { forkJoin, mergeAll, mergeMap, tap } from "rxjs";
import { getValues, doubleValue, tripleValue } from "./service";
getValues()
.pipe(
tap((value) => console.log(`Got ${value.join(", ")}\n`)),
mergeAll(),
tap((value) => console.log(`Processing ${value}`)),
mergeMap((value) => forkJoin([doubleValue(value), tripleValue(value)]))
)