View jest.ts
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 { format } from "pretty-format" | |
import { reactive } from "vue" | |
import { deepEqual, isPromise, Logger, SerialQueue } from "zeed" | |
const log = Logger("jest") | |
let context: any = {} | |
let performedAssertions = 0 | |
let expectAssertions = -1 |
View forceReloadOnIOS.js
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
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.getRegistrations().then(function(registrations) { | |
registrations.map(r => { | |
r.unregister() | |
}) | |
}) | |
window.location.reload(true) | |
} |
View trackWithUmami.php
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
<?php | |
// Adjust these for your needs | |
$umamiCollect = 'https://z-umami.holtwick.de/api/collect'; | |
$website = "6893805d-a37d-4d63-a043-5baec4a6b32c"; | |
// Collected info from original call | |
$language = $_SERVER['HTTP_ACCEPT_LANGUAGE']; | |
$ua = $_SERVER['HTTP_USER_AGENT']; | |
$referrer = $_SERVER['HTTP_REFERER']; // 1x"r" vs 2x"r" !!! |
View log-sentry.ts
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
// See https://github.com/holtwick/zeed | |
import * as Sentry from "@sentry/browser" | |
import { Integrations } from "@sentry/tracing" | |
import { LogHandler, LogLevel, LogMessage, renderMessages } from "zeed" | |
import { DEBUG, RELEASE, SENTRY_DSN } from "@/config" // Use your config here | |
export function LoggerSentryHandler( | |
level: LogLevel = LogLevel.debug |
View yjs-vue3-experiment.vue
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="test-sfu"> | |
<div class="prose"> | |
<h1> | |
<router-link to="/test">Test Vue3 + Yjs</router-link> | |
</h1> | |
<p>Experiment to combine Vue3 reactivity and Yjs realtime sync.</p> | |
<p> | |
Play around on the console by changing values of | |
<code>window.realtime</code> |
View HORegExp.h
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
// Copyright 2012 Dirk Holtwick, holtwick.it. All rights reserved. | |
@import Foundation; | |
#define HORegexDefaultOptions NSRegularExpressionCaseInsensitive | NSRegularExpressionAnchorsMatchLines | NSRegularExpressionAllowCommentsAndWhitespace | |
@interface HORegexMatch : NSTextCheckingResult | |
@property (readonly, nonatomic) NSString *text; | |
@property (readonly, nonatomic) NSTextCheckingResult *match; |
View KeyPathHelper.m
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
// (C)opyright 2018-06-20 Dirk Holtwick, holtwick.it. All rights reserved. | |
#import <Foundation/Foundation.h> | |
#define keyPath(k) YES ? @#k : (k ? @"": nil) | |
#define keyPathFromObject(o, k) YES ? @#k : ((o ?: o.k) ? @"" : nil) | |
@interface Sample : NSObject | |
@property id greeting; | |
@end |
View SeaObject.h
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
// (C)opyright 2018-04-25 Dirk Holtwick, holtwick.it. All rights reserved. | |
#import <Foundation/Foundation.h> | |
/* A dictionary like object that allows to define custom dynamic properties | |
* for typed and easy access. Only simple types like string, number, array and | |
* dictionary are supported. It is mainly thought to be a convenience class that | |
* can be serialized easily to JSON and other formats. | |
* | |
* MAKE SURE to add @dynamic for any property you define in a subclass of SeaObject! |
View SeaDataSpeedTests.m
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
// (C)opyright 2018-02-03 Dirk Holtwick, holtwick.it. All rights reserved. | |
#import <XCTest/XCTest.h> | |
#import "MPMessagePack.h" | |
#import "NSData+GZIP.h" | |
@interface SeaDataSpeedTests : XCTestCase | |
@end |
View proceedsappstore.py
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 glob | |
d = {} | |
for fn in glob.glob('appsales/*.txt'): | |
lines = open(fn, 'r').readlines()[1:] | |
# print fn | |
for l in lines: | |
l = l.split('\t') | |
if len(l) == 18: # only newest format | |
proceeds = float(l[8]) |
NewerOlder