Skip to content

Instantly share code, notes, and snippets.

View squigglezworth's full-sized avatar
🐱

squigz squigglezworth

🐱
  • Canada
View GitHub Profile
@squigglezworth
squigglezworth / di.fm.py
Created October 18, 2022 22:46
Python script for generating playlists for di.fm & the other AudioAddict sites
import argparse, os, requests, random
parser = argparse.ArgumentParser(description='Create PLS files for di.fm & friends streaming sites')
parser.add_argument('key', help='Listening key from di.fm or any other site in the network')
parser.add_argument('--directory', help='Generate playlists in this directory')
group1 = parser.add_argument_group('Sites', "Specify which sites to generate playlists for, or none to generate for all sites")
group1.add_argument('--di', help='di.fm', action='store_true')
group1.add_argument('--classical', help='ClassicalRadio.com', action='store_true')
group1.add_argument('--jazz', help='JAZZRADIO.com', action='store_true')
group1.add_argument('--radio', help='RadioTunes.com', action='store_true')
<!DOCTYPE html>
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<style>
html {
height:100%;
}
body {
--dark: hsla(0,0%,0%,1);
@squigglezworth
squigglezworth / script.js
Last active May 12, 2022 19:03
Apps Script code for sending game quick tips to a Discord webhook
function sendTip() {
const HOOK = "";
const LOGO = 'https://media.discordapp.net/attachments/525755278172356625/970950652815626280/Hideaway_-_Logo.png?width=486&height=486';
const COLOR = 0x299aff;
// Get our 'Tips' sheet...
var book = SpreadsheetApp.getActiveSpreadsheet();
var sheet = book.getSheetByName("Tips");
// ... and then get all the tips out of it ...
@squigglezworth
squigglezworth / script.js
Last active September 5, 2022 11:12
Apps Script for fetching price information for EVE Online items
const METRICS = {'AVGBUY': 'buy.weightedAverage', 'MAXBUY': 'buy.max', 'MINBUY': 'buy.min', 'BUYDEV': 'buy.stddev', 'MEDBUY': 'buy.median', 'BUYVOL': 'buy.volume', 'BUYNUM': 'buy.orderCount', 'PERCBUY': 'buy.percentile', 'AVGSELL': 'sell.weightedAverage', 'MAXSELL': 'sell.max', 'MINSELL': 'sell.min', 'SELLDEV': 'sell.stddev', 'MEDSELL': 'sell.median', 'SELLVOL': 'sell.volume', 'SELLNUM': 'sell.orderCount', 'PERCSELL': 'sell.percentile' };
/**
* Retrieve market information for EVE items
*
* @param {number|string} type Name or ID of an item
* @param {string} metric One of AVGBUY, MAXBUY, MINBUY, BUYDEV, MEDBUY, BUYVOL, BUYNUM, PERCBUY, AVGSELL, MAXSELL, MINSELL, SELLDEV, MEDSELL, SELLVOL, SELLNUM, PERCSELL
* @param {number} region Optional - Region ID. Uses The Forge (Jita) by default
* @return The price for the item based on the metric specified
* @customfunction
*/
@squigglezworth
squigglezworth / script.js
Last active September 5, 2022 11:16
Google Apps Script for retrieving EVE Online typeIDs automatically
function updateTypes() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName("Internal: typeids_full");
var response = UrlFetchApp.fetch("https://www.fuzzwork.co.uk/dump/latest/invTypes-nodescription.csv");
var resource = {
requests: [
{
pasteData: {
@squigglezworth
squigglezworth / SomaFM-streams.sh
Created February 11, 2022 07:26
SomaFM Streams
curl https://somafm.com/m3u/7soul.m3u -o "SomaFM - Seven Inch Soul.m3u"
curl https://somafm.com/m3u/bagel.m3u -o "SomaFM - BAGeL Radio.m3u"
curl https://somafm.com/m3u/beatblender.m3u -o "SomaFM - Beat Blender.m3u"
curl https://somafm.com/m3u/bootliquor.m3u -o "SomaFM - Boot Liquor.m3u"
curl https://somafm.com/m3u/brfm.m3u -o "SomaFM - Black Rock FM.m3u"
curl https://somafm.com/m3u/cliqhop256.m3u -o "SomaFM - cliqhop idm.m3u"
curl https://somafm.com/m3u/covers.m3u -o "SomaFM - Covers.m3u"
curl https://somafm.com/m3u/deepspaceone.m3u -o "SomaFM - Deep Space One.m3u"
curl https://somafm.com/m3u/defcon256.m3u -o "SomaFM - DEF CON Radio.m3u"
curl https://somafm.com/m3u/digitalis.m3u -o "SomaFM - Digitalis.m3u"