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
// https://jsoncanvas.org | |
const convertFromCanvas = (space) => { | |
const yThreshold = 150 | |
let newSpace = {} | |
try { | |
newSpace.name = `Canvas ${utils.journalSpaceName({})}` | |
newSpace.id = nanoid() | |
newSpace.background = consts.defaultSpaceBackground |
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
// https://stackoverflow.com/a/57527009 | |
const disableIOSTextFieldZoom = () => { | |
if (!isIOS()) { return } | |
const element = document.querySelector('meta[name=viewport]') | |
if (element !== null) { | |
let content = element.getAttribute('content') | |
let scalePattern = /maximum\-scale=[0-9\.]+/g | |
if (scalePattern.test(content)) { | |
content = content.replace(scalePattern, 'maximum-scale=1.0') | |
} else { |
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
[ | |
{"id": 1,"name": "txt"}, | |
{"id": 2,"name": "c", "color": "#555555", "keywords": ["auto", "break", "case", "char", "const", "continue", "default", "do", "double", "else", "enum", "extern", "float", "for", "goto", "if", "int", "long", "register", "return", "short", "signed", "sizeof", "static", "struct", "switch", "typedef", "union", "unsigned", "void", "volatile", "while"]}, | |
{"id": 3,"name": "c++", "color": "#f34b7d", "keywords": ["alignas", "alignof", "and", "and_eq", "asm", "auto", "bitand", "bitor", "bool", "break", "case", "catch", "char", "char8_t", "char16_t", "char32_t", "class", "compl", "concept", "const", "consteval", "constexpr", "const_cast", "continue", "co_await", "co_return", "co_yield", "decltype", "default", "delete", "do", "double", "dynamic_cast", "else", "enum", "explicit", "export", "extern", "false", "float", "for", "friend", "goto", "if", "inline", "int", "long", "mutable", "namespace", "new", "noexcept", "not", "not_eq", "nullptr", "operator", "or", "or_eq", "private", "protected |
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> | |
import { reactive, computed, onMounted, defineProps, defineEmits, watch, ref, nextTick } from 'vue' | |
import { useStore } from 'vuex' | |
const store = useStore() | |
import utils from '@/utils.js' | |
const dialog = ref(null) | |
onMounted(() => { |
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
[ | |
{ | |
"name": "Ascension Island", | |
"emoji": "🇦🇨", | |
"unicode": "U+1F1E6 U+1F1E8", | |
"image": "https://cdn.jsdelivr.net/npm/[email protected]/dist/images/AC.svg" | |
}, | |
{ | |
"name": "Andorra", | |
"emoji": "🇦🇩", |
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
try { | |
await postmark.sendEmailBatchWithTemplates(templates) | |
} catch (error) { | |
console.error('🚒 email.bulletin', error) | |
} |
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
async bulletin ({subject, users, exploreSpaces}) { | |
const batches = utils.groupIntoBatches(users) | |
console.log('📧 bulletin', { subject, users: users.length, batches: batches.length }) | |
for (const users of batches) { | |
const templates = users.map(user => { | |
return { | |
From: "[email protected]", | |
To: user.email, | |
TemplateAlias: "bulletin", | |
MessageStream: "bulletins", |
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
groupIntoBatches (array) { | |
const batchSize = 100 | |
const totalBatches = Math.ceil(array.length / batchSize) | |
let batches = [] | |
_.times(totalBatches, (index) => { | |
const start = index * batchSize | |
let end = (index + 1) * batchSize | |
const batch = array.slice(start, end) | |
batches.push(batch) | |
}) |
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
// group cards into overlap groups | |
self.onmessage = function (event) { | |
const offset = 10 | |
const { cards, viewport, zoom } = event.data | |
let newCards = cards.filter(card => isCardInViewport(card, viewport, zoom)) | |
newCards = newCards.map(card => { | |
return { | |
id: card.id, | |
name: card.name, |
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
ᵔᴥᵔ |
NewerOlder