Skip to content

Instantly share code, notes, and snippets.

View tobiaslins's full-sized avatar

Tobias Lins tobiaslins

View GitHub Profile
@tobiaslins
tobiaslins / worker.js
Last active September 27, 2023 15:19
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
const MY_DOMAIN = "help.splitbee.io"
const START_PAGE = "https://www.notion.so/splitbee/Help-Center-bbf26e2b70574901b9c98e5d11e449de"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "GET, HEAD, POST,PUT, OPTIONS",
@tobiaslins
tobiaslins / react-native-maps+0.26.1.patch
Created March 4, 2020 12:42
react-native-maps image loader patch
diff --git a/node_modules/react-native-maps/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m b/node_modules/react-native-maps/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m
index 02c63a5..00bed69 100644
--- a/node_modules/react-native-maps/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m
+++ b/node_modules/react-native-maps/lib/ios/AirGoogleMaps/AIRGoogleMapMarker.m
@@ -270,7 +270,7 @@ - (void)setImageSrc:(NSString *)imageSrc
[self iconViewInsertSubview:_iconImageView atIndex:0];
}
- _reloadImageCancellationBlock = [_bridge.imageLoader loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
+ _reloadImageCancellationBlock = [[_bridge moduleForClass:[RCTImageLoader class]] loadImageWithURLRequest:[RCTConvert NSURLRequest:_imageSrc]
### Keybase proof
I hereby claim:
* I am tobiaslins on github.
* I am tobiaslins (https://keybase.io/tobiaslins) on keybase.
* I have a public key ASASn4OsYcyHnAjQlH_GKpLhD9M9i-aTvunLqw1CCGTLSgo
To claim this, I am signing this object:
@tobiaslins
tobiaslins / TapHandler.tsx
Last active September 21, 2019 18:44
Reanimated Button on Hold
import React, { ReactNode } from "react";
import { ViewStyle } from "react-native";
import { State, TapGestureHandler } from "react-native-gesture-handler";
import Animated, { Easing } from "react-native-reanimated";
import { contains, delay, onGestureEvent, timing } from "react-native-redash";
interface TapHandlerProps {
value: Animated.Value<number>;
onPress: () => void;
onCancel: () => void;
@tobiaslins
tobiaslins / flatarray.js
Last active March 3, 2017 13:16
Flat array
const testArray = [[1,2,[3]],4]
const flatArray = (arr) => arr.reduce((a, b) => {
const newValue = Array.isArray(b) ? flat(b) : b
return a.concat(newValue)
}, [])
console.log(flatArray(testArray))
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-input/paper-input.html">
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1AppScaffold.html">
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1PageContainer.html">
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationStageLeft.html">
<link rel="import" href="../../salesforce/s1-elements/s1StagedNavigationNotifications.html">
<link rel="import" href="../../salesforce/s1-elements/s1AnchorLightDefault.html">
<link rel="import" href="../../salesforce/s1-elements/s1ListWithLabels.html">
<link rel="import" href="../../salesforce/s1-elements/s1AnchorDark.html">
<link rel="import" href="../../salesforce/s1-elements/s1IndicatorDotsLightBackground.html">
<link rel="import" href="../../salesforce/s1-elements/s1ButtonGroups.html">
<link rel="import" href="../../salesforce/s1-elements/scaffold/s1DetailView.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../paper-button/paper-button.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">