Skip to content

Instantly share code, notes, and snippets.

@saiteja09
saiteja09 / StockWidget.js
Last active July 13, 2023 03:47
Stock Widget for iOS using Scriptable
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: deep-blue; icon-glyph: book; share-sheet-inputs: plain-text;
// Stock Ticker Widget
let stocksInfo = await getStockData()
let widget = await createWidget()
if (config.runsInWidget) {
// The script runs inside a widget, so we pass our instance of ListWidget to be shown inside the widget on the Home Screen.
Script.setWidget(widget)
} else {
@diegojancic
diegojancic / TokenGenerator.cs
Created November 3, 2017 14:56
Random string generator, based on
/*
Based on Eric J's answer here: https://stackoverflow.com/a/1344255/72350
- Fixed bias by using 64 characters
- Removed unneeded 'new char[62]' and 'new byte[1]'
- Using GetBytes instead of GetNonZeroBytes
*/
using System.Security.Cryptography;
using System.Text;