uses v-model remove tags by clicking x add new tags by typing and pressing space, comma, period
This file contains 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
<template> | |
<div class="relative"> | |
<input | |
v-model="inputValue" | |
@keyup.prevent="fetchData" | |
type="text" | |
placeholder="Enter postcode" | |
class="border border-gray-300 rounded p-2 w-full" /> | |
<div | |
v-if="postcodesForSelection.length > 0 && showDropdown" |
This file contains 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
--I'm assuming you have already added the 'pgvector' extension to PostgreSQL (https://github.com/pgvector/pgvector) | |
--looks wierd but you invoke the function using select, representing the vector as a string literal.. | |
select * from public.test_function('[1.03, 2.45, 3.56]', .06); |
This file contains 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 'package:shared_preferences/shared_preferences.dart'; | |
import 'dart:convert'; | |
class PersistentStorageService { | |
static Future<List<MyObject>> getMyObjects() async { | |
SharedPreferences prefs = await SharedPreferences.getInstance(); | |
List<String> jsonStringList = prefs.getStringList('my_objects') ?? []; | |
return [ | |
for (var jsonString in jsonStringList) | |
MyObject.fromJson(jsonDecode(jsonString)) |
This file contains 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
<script lang="ts" setup> | |
/* | |
pre-requisites.. Tailwind + DaisyUI | |
setup... | |
import { ModalType } from '~~/components/modal.type'; | |
const myCoolModal = ref<ModalType>(); | |
myCoolModal.value!.open(); |
This file contains 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
<script setup lang="ts"> | |
import { storeToRefs } from 'pinia'; | |
const notifyStore = useNotifyStore(); | |
const { notifications } = storeToRefs(notifyStore); | |
</script> | |
<template> | |
.... | |
<div class="toast toast-end toast-top"> | |
<div v-for="notification in notifications" :class="notification.type"> |
This file contains 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
— My Keyboard was 'enveloping' each Note On message with an 'All Notes Off' message | |
— This resulted in shitty results, especially chords which were morphed into single notes | |
— This Script ignores the initial 'All Notes Off' message and morphs the second one into an appropriate 'Note Up' message | |
property noteonchannel : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} | |
on runme(message) | |
if (item 2 of message = 123) then — All Notes Off | |
copy ((item 1 of message) - 175) to channel | |
if (item channel of noteonchannel > 0) then | |
set item 1 of message to (127 + channel) | |
set item 2 of message to (item channel of noteonchannel) |
This file contains 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
// The coupling constant, higher values tend to converge the model faster | |
const k_const float64 = .006 |
- Create an AWS account
- Create an SQS queue (standard type, not fifo)
- Ensure that the environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are set
- use requirements.txt to get requirements (no I'm not using Celery at all, this is just a cheat way of getting the right dependencies)
- See usage.py for how to enqueue jobs
- run the worker to... work
python3 worker.py
NewerOlder