Skip to content

Instantly share code, notes, and snippets.

// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-green; icon-glyph: cloud-upload-alt;
// https://gist.github.com/schl3ck/2009e6915d10036a916a1040cbb680ac
/*******************************************
* *
* ____ _ _ *
* | _ \ | | | | *
async function drawArc(
on,
percent = 50,
percent2 = -1
) {
const canvSize = 200;
const canvas = new DrawContext();
canvas.opaque = false;
const canvWidth = 18; // circle thickness
const canvRadius = 80; // circle radius
@Sillium
Sillium / TelekomDataService.js
Last active March 1, 2023 13:40
Library to fetch data from Telekom API
console.log("Test");
class TelekomDataService {
/*---
/ STATIC PROPERTIES
/---*/
static fileManager = FileManager.iCloud();
static scriptDir = module.filename.replace(TelekomDataService.fileManager.fileName(module.filename, true), '');
static cacheFile = TelekomDataService.fileManager.joinPath(TelekomDataService.scriptDir, "cache.json");
static historyDir = TelekomDataService.fileManager.joinPath(TelekomDataService.scriptDir, "history");
@Sillium
Sillium / TelekomWidget.js
Created July 5, 2022 21:24
Updated scriptable widget for Telekom data usage
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: purple; icon-glyph: magic;
const DEBUG = false
const log = DEBUG ? console.log.bind(console) : function () { };
const fontSizeBig = 12
const padding = 10
const fontSizeHuge = 36
await createDirectory()
@Sillium
Sillium / README.md
Last active December 8, 2021 13:11 — forked from haranjackson/chrome_headless.py
Deploys the Python Selenium library and Chrome Headless to an AWS Lambda layer. You can specify the region, library version, and runtime. An example Lambda function is given.

After installation, run this:

aws lambda add-layer-version-permission --layer-name ChromeHeadless --statement-id xaccount --action lambda:GetLayerVersion  --principal "*" --version-number X --output text
@Sillium
Sillium / TelekomDataUsage.js
Last active March 1, 2023 13:41
Telekom Data Usage - iOS 14 Widget for Scriptable app
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: exchange-alt;
const DEBUG = false
const log = DEBUG ? console.log.bind(console) : function () { };
// configure the library
const libraryInfo = {
name: 'TelekomDataUsageLibrary',
version: '1.0.3',
const apiUrl = "https://pass.telekom.de/api/service/generic/v1/status"
let widget = await createWidget()
widget.backgroundColor = new Color("#777777")
if (!config.runsInWidget) {
await widget.presentSmall()
}
Script.setWidget(widget)
Script.complete()
@Sillium
Sillium / simplytel.js
Last active November 28, 2019 17:35
CasperJS script to check data usage of SimplyTel mobile phone contract
// Usage: casperjs simplytel.js <login> <password>
var casper = require('casper').create({
verbose: false,
logLevel: "info",
exitOnError: true
});
if (!casper.cli.has(0) || !casper.cli.has(1)) {
casper.echo("\nUsage: casperjs simplytel.js <login> <password>").exit();