Skip to content

Instantly share code, notes, and snippets.

Avatar

Tobias Lins tobiaslins

View GitHub Profile
@tobiaslins
tobiaslins / worker.js
Last active Jul 24, 2020
Notion Custom Domain using Cloudflare Workers + Splitbee Analytics
View worker.js
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 Mar 4, 2020
react-native-maps image loader patch
View react-native-maps+0.26.1.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]
View gist:e6d4116b7b6a901c0bc3fa1c9d40c788
### 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 Sep 21, 2019
Reanimated Button on Hold
View TapHandler.tsx
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;
View flatarray.js
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))
View designer.html
<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">
View designer.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">
View designer.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">
View designer.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">
You can’t perform that action at this time.