Skip to content

Instantly share code, notes, and snippets.

View stigi's full-sized avatar
✌️
Casual coding

Ullrich Schäfer stigi

✌️
Casual coding
View GitHub Profile
@pdarcey
pdarcey / SwiftData.md
Last active July 24, 2024 23:04
SwiftData storage on the Mac

SwiftData storage on the Mac

Where does SwiftData store things on the Mac?

Default Storage Location

On iOS, this directory is in the app's own storage location (app_UUID/Library/Application Support) but, on the Mac, it's a shared location in the user's Library.

By default on the Mac, SwiftData stores its model in the /~/Library/Application Support directory as default.store. (It will also add two other files, default.store-shm and default.store-wal, as the model is stored as a SQLite database, and these are these additional files are part of how SQLite works.)

@pesterhazy
pesterhazy / indexeddb-problems.md
Last active May 27, 2024 07:40
The pain and anguish of using IndexedDB: problems, bugs and oddities

This gist lists challenges you run into when building offline-first applications based on IndexedDB, including open-source libraries like Firebase, pouchdb and AWS amplify (more).

Note that some of the following issues affect only Safari. Out of the major browsers, Chrome's IndexedDB implementation is the best.

Backing file on disk (WAL file) keeps growing (Safari)

When this bug occurs, every time you use the indexeddb, the WAL file grows. Garbage collection doesn't seem to be working, so after a while, you end up with gigabytes of data.

Random exceptions when working with a large number of indexeddb databases (Safari)

This document will be a part of the upcoming re-frame website.

On Derived Data

The UI is just derived data.

At each moment, the DOM displayed is a "materialised view" of what is in app-db.

Domino 3 modifies app-db and then boom, boom, boom go dominoes 4, 5 & 6, automatically producing this "materialised view", via a data flow.

@Intyre
Intyre / Wahoo_Elemnt.md
Last active June 25, 2024 14:44
Wahoo Elemnt - Tips, tricks and custom images
@yogthos
yogthos / clojure-beginner.md
Last active July 15, 2024 20:45
Clojure beginner resources

Introductory resources

// @flow
import { map, is } from 'rambdax'
import type { DirtyRaw } from '@nozbe/watermelondb/RawRecord'
import type { SyncLog } from '@nozbe/watermelondb/sync'
// beginning, end, length
const censorValue = (value: string): string =>
`${value.slice(0, 2)}***${value.slice(-2)}(${value.length})`
const shouldCensorKey = (key: string): boolean =>
@swalkinshaw
swalkinshaw / tutorial.md
Last active November 13, 2023 08:40
Designing a GraphQL API
@pesterhazy
pesterhazy / promises-passing-values.cljs
Last active October 24, 2021 00:55
Promise chains in ClojureScript and the problem of previous values
(ns my.promises
"Demo to show different approaches to handling promise chains in ClojureScript
In particular, this file investigates how to pass data between Promise
callbacks in a chain.
See Axel Rauschmayer's post
http://2ality.com/2017/08/promise-callback-data-flow.html for a problem
statement.
@Taytay
Taytay / Hubot-YNAB-PullRequest.coffee
Last active August 14, 2019 20:14
Part of our Hubot script that responds to commands in Github Pull Requests - use in conjunction with https://github.com/ynab/hubot-github-adapter
# Description:
# Helper commands for YNAB Pull Requests
#
# Commands:
# hubot rebuild - Rebuilds this branch.
# hubot ketchup|catchup|catch_up|upbase|reverse integrate|reverse_integrate|backmerge|back_merge - Merges the target branch back into this pull request branch.
TextMessage = require('hubot').TextMessage
GitHubApi = require("github"); # https://github.com/mikedeboer/node-github
@pbock
pbock / buergerbot.rb
Last active April 22, 2024 10:58
Bürgerbot: Refreshes the Berlin Bürgeramt page until an appointment becomes available, then notifies you.
#!/usr/bin/env ruby
require 'watir-webdriver'
def log (message) puts " #{message}" end
def success (message) puts "+ #{message}" end
def fail (message) puts "- #{message}" end
def notify (message)
success message.upcase
system 'osascript -e \'Display notification "Bürgerbot" with title "%s"\'' % message
rescue StandardError => e