Skip to content

Instantly share code, notes, and snippets.

@dmr121
dmr121 / TinderSwiper.swift
Created November 30, 2023 21:17
Tinder-Like Card Swiper in SwiftUI
//
// ContentView.swift
// TinderCardsDemo
//
// Created by David Rozmajzl on 11/28/23.
//
import SwiftUI
struct ContentView: View {
@dmr121
dmr121 / tar.gz-to-data.ts
Last active February 13, 2023 18:11
Download .tar.gz file from remote URL and convert the contents to JSON data
import axios from "axios";
import tar from "tar-stream";
import { ungzip } from "node-gzip";
// The data being fetched is assumed to be a .tar.gz archive with one .json file inside
export const convertTarGZFileToJSON = async (url: string): Promise<any[]> => {
return new Promise((resolve, reject) => {
axios(url, {
responseType: "arraybuffer",
})
@dmr121
dmr121 / PomodoroPicker.swift
Last active April 7, 2024 22:00
SwiftUI - Snapping horizontal scrolling pomodoro picker
//
// PomodoroPicker.swift
// pomodoro
//
// Created by David Rozmajzl on 1/1/22.
//
import SwiftUI
struct PomodoroPicker<Content, Item: Hashable>: View where Content: View {
@dmr121
dmr121 / functions.php
Created March 18, 2021 17:50
Removes 'article:updated_time' and 'article:modified_time' to prevent dates to be shown in meta shares previews on WordPress post links
add_filter(
'wpseo_frontend_presenter_classes',
function ($filter) {
if (($key = array_search('Yoast\WP\SEO\Presenters\Open_Graph\Article_Modified_Time_Presenter', $filter)) !== false) {
unset($filter[$key]);
}
if (($key = array_search('Yoast\WP\SEO\Presenters\Open_Graph\Article_Published_Time_Presenter', $filter)) !== false) {
unset($filter[$key]);