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
lambda_functions=$(aws lambda list-functions | jq -r '.Functions' | jq -c '.[]') | |
for function in $lambda_functions | |
do | |
function_name=$(echo $function | jq -r '.FunctionName') | |
current_version=$(echo $function | jq -r '.Version') | |
lambda_versions=$(aws lambda list-versions-by-function --function-name $function_name | jq -r '.Versions' | jq -c '.[]') | |
for version in $lambda_versions | |
do |
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 count = 0; | |
function getAllButtons() { | |
return document.querySelectorAll('button.is-following') || []; | |
} | |
async function unfollowAll() { | |
const buttons = getAllButtons(); |
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 { useEffect, useRef } from 'react' | |
export function useWhyDidYouUpdate(name: string, props: Record<string, any>) { | |
const latestProps = useRef(props) | |
useEffect(() => { | |
const allKeys = Object.keys({ ...latestProps.current, ...props }) | |
const changesObj: Record<string, { from: any; to: any }> = {} | |
allKeys.forEach(key => { |
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 React from 'react' | |
import { StatusBar, Text, View } from 'react-native' | |
import { useSafeArea } from 'react-native-safe-area-context' | |
export function App() { | |
const safeAreaInsets = useSafeArea() | |
return ( | |
<View | |
style={{ |
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
#!/bin/sh | |
# Darkify Slack on Mac OS: | |
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js" | |
# Thanks to: https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99#gistcomment-2358430 | |
if [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then | |
# Backup original CSS for reverts: | |
cp ${SLACK_INTEROP_JS} ${SLACK_INTEROP_JS}.bak | |
echo 'document.addEventListener("DOMContentLoaded",function(){let tt__customCss=`body{background:#222;color:#e6e6e6}a{color:#949494}a:link,a:visited{color:#949494}a:active,a:focus,a:hover{color:#c7c7c7}hr{border-bottom:1px solid #424242;border-top:1px solid #222}h1,h2,h3,h4{color:#e6e6e6}h1 a{color:#e6e6e6}h1 a:active,h1 a:hover,h1 a:link,h1 a:visited{color:#e6e6e6}.bordered{border:1px solid #363636}.top_border{border-top:1px solid #363636}.bottom_border{border-bottom:1px solid #363636}.left_border{border-left:1px solid #363636}.right_border{border-right:1px solid #363636}.bullet{color:#949494}.alert,.c-alert,.c-alert--bo |
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 React from 'react' | |
import { Button, Text, View } from 'react-native' | |
import { useDispatch } from 'react-redux' | |
import { useReduxState } from '../hooks/use-redux-state' | |
import * as actions from '../redux/actions' | |
import * as selectors from '../redux/selectors' | |
export function LoginScreen() { | |
const dispatch = useDispatch() |
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
// Demo: https://snack.expo.io/@brunolemos/touch-button-scale-effect | |
import React from 'react' | |
import { Animated, StyleProp, TouchableWithoutFeedback, TouchableWithoutFeedbackProps, ViewStyle } from 'react-native' | |
import { styleMerge } from 'shared/src/utils' | |
export interface TouchableScaleProps extends TouchableWithoutFeedbackProps { | |
containerStyle?: StyleProp<ViewStyle> | |
} |
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
// Source: https://github.com/react-community/react-native-platform-touchable | |
import React, { PureComponent, ReactNode } from 'react' | |
import { | |
BackgroundPropType, | |
Platform, | |
StyleProp, | |
TouchableNativeFeedback, | |
TouchableNativeFeedbackProperties, | |
TouchableNativeFeedbackStatic, | |
TouchableOpacity, |
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
// Live demo: https://snack.expo.io/@brunolemos/tabview | |
import React, { Component } from 'react'; | |
import { Platform, StyleSheet, View } from 'react-native'; | |
import { Constants } from 'expo'; | |
import TabView from './components/TabView'; | |
const routes = [{ index: 0, title: 'Tab 0' }, { index: 1, title: 'Tab 1' }]; |
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
@withTest('myNewPropName') | |
export default class App extends PureComponent... |
NewerOlder