Skip to content

Instantly share code, notes, and snippets.

View extratone's full-sized avatar
🗿
sudo exit

David Blue extratone

🗿
sudo exit
View GitHub Profile
@extratone
extratone / arena-random-image-widget.js
Created April 27, 2023 18:05 — forked from jacopocolo/arena-random-image-widget.js
Scriptable widget that load a random image from an are.na channel
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: black; icon-glyph: user-md;
// just replace the url below with the url if the channel you want to use
// image channels only, doesnt supoort text or anything else
const channel = 'https://www.are.na/una/color-tx32pz_qsu0'
const url = 'https://api.are.na/v2/channels/'+channel.substring(channel.lastIndexOf('/') + 1)+'/contents';
const req = new Request(url)
@extratone
extratone / Add from Gist.wkflw
Created April 19, 2023 10:08 — forked from omz/Add from Gist.wkflw
Imports a workflow or script from a Gist URL in the clipboard into the commands menu.
This gist contains a workflow for Editorial, an app for
writing plain text and markdown on iOS.
To import the workflow, copy the *entire* text of the gist,
then open Editorial and create a new workflow.
------------ BEGIN WORKFLOW ------------
{
"actions" : [
{
@extratone
extratone / UpsideDownText.py
Created April 19, 2023 10:01 — forked from omz/UpsideDownText.py
UpsideDownText.py
import ui
# Mapping based on http://www.upsidedowntext.com/unicode
CHARMAP = {'!': '\xc2\xa1', '"': ',,',
"'": ',', '&': '\xe2\x85\x8b',
')': '(', '(': ')', ',': "'",
'.': '\xcb\x99',
'1': '\xc6\x96',
'0': '0', '3': '\xc6\x90',
'2': '\xe1\x84\x85',
@extratone
extratone / SetTheme.py
Created April 19, 2023 09:57 — forked from omz/SetTheme.py
SetTheme.py
# Utility functions for setting UI/syntax highlighting theme in Pythonista (1.6 beta) using objc_util. WARNING: This relies on some internals that may change in the future.
# When run as a script, it toggles between the default (light) theme and Tomorrow-Dark.
from objc_util import *
import os
import glob
def get_theme_names():
res_path = str(ObjCClass('NSBundle').mainBundle().resourcePath())
theme_paths = glob.glob(os.path.join(res_path, 'Themes2/*.json'))
@extratone
extratone / Pythonista Theme Editor.py
Created April 19, 2023 09:56 — forked from omz/Pythonista Theme Editor.py
Pythonista Theme Editor.py
# coding: utf-8
'''
Basic theme editor for Pythonista 1.6 (beta)
WARNING: Use at your own risk! User themes aren't "officially" supported, and
this may break in future versions. If you enter invalid JSON or anything else
that the app can't deal with, it *will* crash -- your input is not validated
in any way.
'''
@extratone
extratone / Barcode Scanner.py
Created April 19, 2023 09:55 — forked from omz/Barcode Scanner.py
Barcode Scanner.py
# coding: utf-8
# Barcode scanner demo for Pythonista
# Based on http://www.infragistics.com/community/blogs/torrey-betts/archive/2013/10/10/scanning-barcodes-with-ios-7-objective-c.aspx
from objc_util import *
from ctypes import c_void_p
import ui
import sound
found_codes = set()
@extratone
extratone / lexers.rb
Created April 16, 2023 04:27 — forked from ttscoff/lexers.rb
Find the perfect lexer to highlight your fenced code blocks and other fancy stuff. If you know the common name of a language or a common file extension for it, this script will tell you exactly what most syntax highlighters will recoghize.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'optparse'
# Have you ever been adding code to a Markdown post and
# wondered what syntax label would give you the right
# highlighting for your fenced code block? This script can
# take either a file extension or a common name of a language
# and let you know what lexers are supported for it, as well
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd">
<en-export export-date="20130730T205637Z" application="Evernote" version="Evernote Mac">
<note>
<title>Test Note for Export</title>
<content>
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Hello, World.
@extratone
extratone / GoogleSearch.py
Created April 14, 2023 13:34 — forked from omz/GoogleSearch.py
GoogleSearch
# Google Search for Pythonista (iOS)
# Searches Google and copies the first result to the clipboard as
# a Markdown link in the form [title](url).
#
# Inspired by Brett Terpstra's SearchLink:
# http://brettterpstra.com/searchlink-automated-markdown-linking-improved/
import clipboard
def google(terms):
@extratone
extratone / bytes.rb
Created April 14, 2023 12:59 — forked from ttscoff/bytes.rb
Convert file sizes between human-readable and machine representations
#!/usr/bin/ruby
module Bytes
def to_human(n,fmt=false)
count = 0
formats = %w(B KB MB GB TB PB EB ZB YB)
while (fmt || n >= 1024) && count < 8
n /= 1024.0