Skip to content

Instantly share code, notes, and snippets.

View haileyok's full-sized avatar

hailey haileyok

View GitHub Profile
@haileyok
haileyok / functions.sql
Last active December 27, 2025 23:21
Clickhouse ATProto Functions
-- CREATE FUNCTION atUriToBskyUrl AS (uri) -> concat(
-- 'https://bsky.app/profile/',
-- arrayElement(splitByChar('/', assumeNotNull(uri)), 3),
-- '/post/',
-- arrayElement(splitByChar('/', assumeNotNull(uri)), 5)
-- );
CREATE FUNCTION userIdToBskyProfile AS (userId) -> concat(
'https://bsky.app/profile/',
userId
// All calling code should properly handle locking
func (edi *EventDataInserter) hasNewColumns(data map[string]any) bool {
for key := range data {
if edi.schemaCache[strings.ToLower(key)] {
continue
}
return true
}
return false
import base64
import logging
from datetime import datetime, timedelta, timezone
from enum import Enum
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Sequence
from google.cloud import bigquery
from osprey.engine.query_language import parse_query_to_validated_ast
from osprey.engine.query_language.ast_bigquery_translator import BQTranslator
from osprey.worker.lib.singletons import CONFIG, ENGINE
import operator
from typing import Any, Callable, Dict, List, get_origin
from google.cloud import bigquery
from pydruid.query import Query
from osprey.engine.ast import grammar
from osprey.engine.ast_validator.validation_context import ValidatedSources
from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs
from osprey.engine.ast_validator.validators.validate_static_types import ValidateStaticTypes
from osprey.engine.udf.base import QueryUdfBase, UDFBase
import operator
from typing import Any, Callable, Dict, List
from google.cloud import bigquery
from osprey.engine.ast import grammar
from osprey.engine.ast_validator.validation_context import ValidatedSources
from osprey.engine.ast_validator.validators.validate_call_kwargs import ValidateCallKwargs
from osprey.engine.udf.base import QueryUdfBase
from osprey.engine.utils.osprey_unary_executor import OspreyUnaryExecutor
@haileyok
haileyok / migrate.js
Last active August 7, 2025 20:45
Migrate PDS script
import AtpAgent from '@atproto/api'
import { Secp256k1Keypair } from '@atproto/crypto'
import * as ui8 from 'uint8arrays'
const OLD_PDS_URL = 'https://bsky.social'
const NEW_PDS_URL = 'https://pds.haileyok.com'
const CURRENT_HANDLE = 'haileyok.com'
const CURRENT_PASSWORD = ''
const NEW_HANDLE = 'newphone.pds.haileyok.com'
const NEW_ACCOUNT_EMAIL = ''
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="40497184-ca50-4998-af8a-2bafdaf7bcab",e._sentryDebugIdIdentifier="sentry-dbid-40497184-ca50-4998-af8a-2bafdaf7bcab")}catch(e){}}();var _sentryModuleMetadataGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};_sentryModuleMetadataGlobal._sentryModuleMetadata=_sentryModuleMetadataGlobal._sentryModuleMetadata||{},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack]=Object.assign({},_sentryModuleMetadataGlobal._sentryModuleMetadata[new _sentryModuleMetadataGlobal.Error().stack],{"_sentryBundlerPluginAppKey:letta-web-ui":!0}),(()=>{var e={29297:e=>{"use strict";e.exports=function(e){function t(e,t,a,n){function r(t){"function"!=typeof self.postMessage?e.ports[0].postMessage(t):self.postMessage(t)}a?("undefine
func (f *F) GetImageHash(filepath string) (string, error) {
start := time.Now()
cmd := exec.Command(f.pdqPath, filepath)
out, err := cmd.StdoutPipe()
if err != nil {
return "", err
}
if err := cmd.Start(); err != nil {
import React from 'react'
import {
Platform,
requireNativeComponent,
StyleSheet,
UIManager,
ViewStyle,
TextProps,
Text as RNText
} from 'react-native'
const circle1Style = useAnimatedStyle(() => ({
opacity: interpolate(
likeIconAnimValue.value,
[0, 0.1, 0.95, 1],
[0, 0.4, 0.4, 0],
'clamp',
),
transform: [
{
scale: interpolate(