Skip to content

Instantly share code, notes, and snippets.

View siathalysedI's full-sized avatar
🎯
Focusing

Arnstein Henriksen siathalysedI

🎯
Focusing
View GitHub Profile
@siathalysedI
siathalysedI / tabdump.scpt
Created May 2, 2025 05:44 — forked from vorg/tabdump.scpt
Copy all Safari tabs title and url as markdown
(*Adapted from https://stackoverflow.com/a/39820517*)
set r to "" -- an empty variable for appending a string
tell application "Safari"
repeat with w in windows -- loop for each window, w is a variable which contain the window object
if exists current tab of w then -- is a valid browser window
repeat with t in tabs of w -- loop for each tab of this window, , t is a variable which contain the tab object
-- get the title (name) of this tab and get the url of this tab
tell t to set r to r & "- [ ] [" & name & "](" & URL & ")" & linefeed -- append a line to the variable (r)
(*
'linefeed' mean a line break
@siathalysedI
siathalysedI / demo.ts
Created December 31, 2024 09:15 — forked from vedantroy/demo.ts
SQLite-backed key-value store with JS-like object manipulation and automatic JSON serialization.
import Database from 'better-sqlite3';
import { createDatabaseClient } from './proxy.ts';
// 1) Create an in-memory DB and your table(s).
const db = new Database(':memory:');
db.exec(`
CREATE TABLE users (
id TEXT PRIMARY KEY,
data JSON
);
@siathalysedI
siathalysedI / index.php
Created December 19, 2024 10:31 — forked from Tynael/index.php
Test PostgreSQL default connection with PHP
<?php
var_dump(
pg_connect("
host=localhost
port=5432
dbname=postgres
user=postgres
password=root
")
@siathalysedI
siathalysedI / db-test.php
Created December 19, 2024 09:13 — forked from mattstein/db-test.php
PHP MySQL/PostgreSQL Connection Test
<?php
/**
* Database Connection Tester
* A quick-and-dirty standalone script for checking PHP’s connection to a
* MySQL (or MariaDB) or PostgreSQL database.
*
* To use, enter the settings below and run the following from your terminal:
* ```
* php -f db-test.php
@siathalysedI
siathalysedI / index.html
Created December 18, 2024 09:02 — forked from chrisvfritz/index.html
Simplest possible HTML template
<!doctype html>
<html>
<head>
<title>This is the title of the webpage!</title>
</head>
<body>
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p>
</body>
</html>
#!/bin/bash
# Counters for Maven and Gradle projects
maven_count=0
gradle_count=0
echo "Starting to clean projects..."
# Recursively find directories containing pom.xml and run 'mvn clean'
while IFS= read -r -d '' file; do
@siathalysedI
siathalysedI / voice_translator.py
Created August 1, 2024 17:33 — forked from mouredev/voice_translator.py
Traductor de voz a diferentes idiomas utilizando IA y Gradio para la creación de la UI Web
import gradio as gr
import whisper
from translate import Translator
from dotenv import dotenv_values
from elevenlabs.client import ElevenLabs
from elevenlabs import VoiceSettings
# requirements.txt
"""
gradio
@siathalysedI
siathalysedI / manifest-v2-chrome.md
Created June 10, 2024 04:59 — forked from velzie/manifest-v2-chrome.md
How to keep using adblockers on chrome and chromium

How to keep using adblockers on chrome and chromium

  1. google's manifest v3 has no analouge to the webRequestBlocking API, which is neccesary for (effective) adblockers to work
  2. starting in chrome version 127, the transition to mv3 will start cutting off the use of mv2 extensions alltogether
  3. this will inevitably piss of enterprises when their extensions don't work, so the ExtensionManifestV2Availability key was added and will presumably stay forever after enterprises complain enough

You can use this as a regular user, which will let you keep your mv2 extensions even after they're supposed to stop working

Linux

In a terminal, run:

@siathalysedI
siathalysedI / android_instructions.md
Created March 6, 2023 03:08 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@siathalysedI
siathalysedI / USING-DIFFMERGE.md
Created March 1, 2023 21:13 — forked from smoll/USING-DIFFMERGE.md
Using DiffMerge as your git mergetool (for Mac OS X / macOS)