This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <pebble.h> | |
| // The spiral is the hand, not decoration. | |
| // | |
| // r(theta) = r_s * phi^(theta / 90deg) -- a golden spiral, growing by phi each | |
| // quarter turn. The whole curve rotates 30 degrees per hour (0.5 deg/minute), | |
| // so the radius at which it crosses the vertical axis scales by phi^(1/3) every | |
| // hour. The hour ticks sit at exactly those crossing radii, and you read the | |
| // time off wherever the curve cuts the ladder. | |
| // |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <pebble.h> | |
| static Window *s_window; | |
| static Layer *s_layer; | |
| static AppTimer *s_timer; | |
| static char s_time[8]; | |
| static char s_day_name[8]; | |
| static char s_month_name[12]; | |
| static char s_year_str[8]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Flask application for converting images to 3D using Apple's SHARP model. | |
| Installation: | |
| 1. Clone ml-sharp repository: | |
| git clone https://github.com/apple/ml-sharp | |
| cd ml-sharp | |
| pip install -r requirements.txt | |
| 2. Install Flask and Flask-CORS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Flask application for converting images to 3D using Apple's SHARP model. | |
| Installation: | |
| 1. Clone ml-sharp repository: | |
| git clone https://github.com/apple/ml-sharp | |
| cd ml-sharp | |
| pip install -r requirements.txt | |
| 2. Install Flask and Flask-CORS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <errno.h> | |
| #include <fcntl.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> | |
| #include <arpa/inet.h> | |
| #include <netdb.h> | |
| #include <sys/resource.h> | |
| #include <sys/time.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| // Detect environment | |
| const detectEnvironment = () => { | |
| const ua = navigator.userAgent; | |
| const isVSCode = ua.includes('Visual Studio Code') || | |
| typeof acquireVsCodeApi !== 'undefined' || | |
| window.vscodeApi !== undefined; | |
| const isElectron = ua.includes('Electron') || typeof require !== 'undefined'; | |
| const isChrome = /Chrome/.test(ua) && !/Edge/.test(ua); | |
| const isFirefox = /Firefox/.test(ua); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| import os | |
| import pyaudio | |
| from cartesia import AsyncCartesia | |
| async def streaming_stt_example(): | |
| """ | |
| Advanced async STT example for real-time streaming applications. | |
| This example captures microphone input and processes it in real-time | |
| with proper error handling and demonstrates endpointing and word timestamp features. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This function estimates the corner radius of a window by checking multiple directions from each corner | |
| # and finding the distance where the image changes from transparent to solid. | |
| # It’s useful for detecting rounded corners in screenshots of macOS windows or pixel data of images etc. | |
| def estimate_corner_radius(self, image_or_array, threshold=128, samples=8): | |
| import math | |
| import numpy as np | |
| # if input is a PIL Image, convert to numpy array | |
| if hasattr(image_or_array, 'convert'): |