This file contains hidden or 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 type { LayoutServerLoad } from './$types'; | |
import { ServicesOffered } from '$lib/db/schema'; | |
import { db } from '$lib/db/db'; | |
export const load = (async () => { | |
const result1 = await db.query.ServicesOffered.findMany({ | |
select: { | |
id: true, | |
name: true |
This file contains hidden or 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
#!/bin/bash | |
set -e | |
# Define the backup base path | |
backup_base_path="backups" | |
# Check if the service name argument is provided | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <service_name>" | |
exit 1 |
This file contains hidden or 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
const keyValueStore = new KeyValueStore('./key-value-store.txt'); | |
// Get a value from the store | |
const value = await keyValueStore.get('key1'); | |
// Set a value in the store | |
await keyValueStore.set('key2', 'value2'); |
This file contains hidden or 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
# Set log level | |
set("log.level", 4) | |
# Capture audio from the ALSA sound card interface | |
input_stream = input.alsa(device="default") | |
# Function to add breaks every minute | |
def add_breaks(~duration, s) = | |
let duration = duration * 60. in | |
sequence([s, blank(duration)]) |
This file contains hidden or 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
# Set log level | |
set("log.level", 4) | |
# Capture the remote Shoutcast stream | |
input_stream = input.http("http://your.shoutcast.server/stream") | |
# Function to add breaks every minute | |
def add_breaks(~duration, s) = | |
let duration = duration * 60. in | |
sequence([s, blank(duration)]) |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"net/url" | |
"github.com/gorilla/websocket" | |
"github.com/hajimehoshi/go-mp3" |
This file contains hidden or 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
<script> | |
import { onMount } from 'svelte'; | |
import { writable } from 'svelte/store'; | |
const messages = writable([]); | |
onMount(() => { | |
const evtSource = new EventSource('/sse'); // Point to path | |
evtSource.onmessage = function (event) { | |
var dataobj = JSON.parse(event.data); |
This file contains hidden or 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
To build IDJC (Internet DJ Console) on the latest version of Ubuntu, you can follow these steps: | |
1. Update your system: | |
``` | |
sudo apt update | |
sudo apt upgrade | |
``` | |
2. Install the required dependencies: | |
``` |
This file contains hidden or 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
APP_NAME="<APP_NAME>" | |
APP_TOKEN="<APP_TOKEN>" | |
CAPROVER_URL="https://apps.your-caprover-hostname.com" |
This file contains hidden or 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
#!/bin/bash | |
<< BLOCK | |
MIT License. Do as you wish with this. | |
Author: 2023 Nick Maietta <[email protected]> | |
This is a bash script that deploys a SvelteKit application to CapRover using the Node 18 enviornment on Alpine Linux. | |
The script starts by checking if the user has provided an environment name as a command-line argument. If no argument |