Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/osascript
function run(input, parameters) {
const appNames = [];
const skipAppNames = [];
const verbose = true;
const scriptName = "close_notifications_applescript";
public class CTMTextMessage {
// Your api keys from account settings
private static String apiKey() { return 'your-key'; }
private static String apiSec() { return 'your-sec'; }
private static String apiHost() { return 'api.calltrackingmetrics.com'; }
private static String apiAccount() { return 'your-account-id'; }
private static String apiAuthorization() {
return 'Basic ' + EncodingUtil.base64Encode(Blob.valueOf(apiKey() + ':' + apiSec()));
}
sub_topics = [ ... ] # say you give it like 800 topics.
prompt =
Here is a set of JSON encoded topics: #{sub_topics.to_json}.
Please generalize these into a smaller set of no more then 10 topics.
Your new generalized topics may be expressed as multiple words.
Output as a JSON object of the new topics and the sub topics that belong to each topic.
e.g. given ['sub topic 1', 'sub topic 2', 'sub topic 3', ...] group them into parent topics like {'topic1': ['sub topic 1', 'sub topic
outputing as JSON
static VALUE callback_exception(VALUE did_raise, VALUE exception) {
VALUE ret = rb_funcall(exception, rb_intern("message"), 0);
VALUE trace = rb_funcall(exception, rb_intern("backtrace"), 0);
if (RB_TYPE_P(trace, T_ARRAY) && RARRAY_LEN(trace) > 0) {
printf("we got an exception: %s:%d\n", StringValueCStr(ret), RARRAY_LEN(trace));
VALUE sep = rb_str_new_cstr("\n");
VALUE trace_lines = rb_ary_join(trace, sep);
if (RB_TYPE_P(trace_lines, T_STRING)) {
printf("%s\n", StringValueCStr(trace_lines));
} else {
setInterval( () => { document.querySelectorAll('.subscribe-dialog').forEach( (e) => { e.style.display = 'none' }); document.querySelectorAll('.subscribe-dialog-scroll-modal-scroll-capture').forEach( (e) => { e.style.display = 'none' }) }, 1);
Linking .pio/build/um_tinys3/firmware.elf
Retrieving maximum program size .pio/build/um_tinys3/firmware.elf
Checking size .pio/build/um_tinys3/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 14.1% (used 46240 bytes from 327680 bytes)
Flash: [== ] 23.6% (used 787149 bytes from 3342336 bytes)
Building .pio/build/um_tinys3/firmware.bin
esptool.py v4.2.1
Creating esp32s3 image...
Merged 2 ELF sections
#!/bin/bash
# make a phone call to a given number, play a message and hangup.
# export CTM_API_KEY, CTM_API_SECRET and CTM_ENDPOINT you can get them from either /accounts/edit or /agencies/{id}/edit pages
# export CTM_ACCOUNT_ID=your account id
read -r -d '' request_body << request-json-body
{
"call_number": "${TO_NUMBER}",
"from_number": "${FROM_NUMBER}",
"route": "hangup",
#!/bin/bash
# using ctm forms api to manage creation, updates and destruction of forms
# as well as submitting data to the forms
# external to this script you should
# export CTM_API_KEY, CTM_API_SECRET and CTM_ENDPOINT you can get them from either /accounts/edit or /agencies/{id}/edit pages
# export CTM_ACCOUNT_ID=your account id
# form options include:
<< 'fields-avialable'
@taf2
taf2 / Gemfile
Created June 13, 2022 13:24
Here's a gist showing what breaks when running the examples for ruby torchtext
source 'https://rubygems.org'
gem "torchtext"
<html>
<head>
<script async src="https://app.calltrackingmetrics.com/assets/ctm-phone-a4abb987e3ee84eea639cab343e2bfd5.js"></script>
</head>
<body>
<ctm-phone></ctm-phone>
</body>
</html>