Skip to content

Instantly share code, notes, and snippets.

public class CTMApexTextMessage {
// Your api keys from account settings
private static String apiKey() { return 'your-api-key'; }
private static String apiSec() { return 'your-api-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()));
}
@taf2
taf2 / possible_now_dnc_checking.js
Created November 1, 2024 13:26
Using the PossibleNow API to filter who can be dialed or not based on Flags
// https://staging.dncsolution.com/Rest/Help
exports.handler = async (event, context) => {
const apihashkey = process.env['apihashkey'];
const clientid = process.env['clientid'];
const userid = process.env['userid'];
const profileid = process.env['profileid'];
const call = event.activity; // call, text, chat, form, video, fax, etc...
const url = `https://staging.dncsolution.com/Rest/${clientid}/Quickcheck/${userid}/${profileid}/${call.caller_number_bare}`;
// const url = `https://staging.dncsolution.com/Rest/${clientid}/Quickcheck/${userid}/${profileid}/3057604895`;
<!DOCTYPE html>
<html>
<head>
<title>Home Page</title>
<script src="https://<%= ctm_host %>/ctm-phone-embed-1.0.js"></script>
</head>
<body>
<h1>Your Application</h1>
<p>Embedding the CTM Phone</p>
<ctm-phone-embed access="/api/ctm_access" popout="/device"></ctm-phone-embed>
#!/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