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 { NavigationContainer, useFocusEffect } from "@react-navigation/native"; | |
import React from 'react'; | |
import { | |
Button, | |
Dimensions, | |
SafeAreaView, | |
ScrollView, | |
StyleSheet, | |
Text, useWindowDimensions, | |
View |
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
function sdkPayment() { | |
return ({shouldFail}, ...args) => { | |
console.log(args) | |
console.log('💳 Starting SDK payment') | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
if (shouldFail) { | |
reject({ | |
state: 'failed', | |
reason: 'Not enough funds', |
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
let mapleader = "," | |
set ideajoin | |
set noerrorbells | |
set visualbell | |
set surround | |
set ignorecase | |
set smartcase | |
set incsearch |
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
const machine = Machine({ | |
id: 'shape', | |
initial: 'idle', | |
devTools: true, | |
context: { | |
mode: 'poly', | |
points: [], | |
shapes: [], | |
}, | |
states: { |
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
const guidedEvent = target => ({ | |
target, | |
actions: assign({ | |
waitingForGuidedEvent: (context, event) => false | |
}) | |
}) | |
const updateStates = (isGuided) => { | |
const guidedWrapper = isGuided ? guidedEvent : x => x; |
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
@-moz-document domain("riot.im") { | |
.mx_EventTile { | |
padding-top: 9px; | |
} | |
.mx_EventTile_line { | |
padding-top: 1px; | |
padding-bottom: 0px; | |
} | |
} |
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
@-moz-document domain("riot.im") { | |
.mx_EventTile { | |
padding-top: 4px; | |
} | |
.mx_EventTile_line { | |
padding-top: 1px; | |
padding-bottom: 0; | |
} | |
} |
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
@-moz-document domain("riot.im") { | |
/* | |
Base0: 839496 | |
Base1: 93a1a1 | |
Base02: 073642 | |
Base03: 002b36 | |
Yellow: b58900 | |
Blue: 268bd2 | |
*/ |
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
const debugBoxColors = ['#f00', '#0f0', '#00f', '#0ff', '#f0f', '#ff0', '#fff']; | |
function debugBox(obj) { | |
const color = debugBoxColors.shift(); | |
debugBoxColors.push(color); | |
return { | |
borderColor: color, | |
borderWidth: 1, | |
...obj | |
} | |
} |
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
function keyedReducer(key, reducer, initialState) { | |
return (state=initialState, action) => { | |
// Having to explicitly handle this sucks. | |
if (action.type.startsWith('@@')) { | |
return state | |
} | |
// What if `action` is not handled by this reducer? | |
return state.update(key(action), s => reducer(s, action)) | |
} | |
} |
NewerOlder