if you're using fish shell, you can add this in your fish config:
let g:fzf_colors = {
\ 'fg': ['fg', 'Normal'],
\ 'bg': ['bg', 'Normal'],
function doSomething() { | |
return dispatch => | |
fetch( | |
'/api/something' | |
).then( | |
response => response.json() | |
).then( | |
json => dispatch({ type: DO_SOMETHING, json }), | |
err => dispatch({ type: SOMETHING_FAILED, err }) | |
); |
/* | |
A Tour of Go: page 44 | |
http://tour.golang.org/#44 | |
Exercise: Loops and Functions | |
As a simple way to play with functions and loops, implement the square root function using Newton's method. | |
In this case, Newton's method is to approximate Sqrt(x) by picking a starting point z and then repeating: z - (z*z - x) / (2 * z) |
package Foo | |
import "fmt" | |
func Fn() { | |
fmt.Printf("foo") | |
} |
Consider the following scenario:
λ tree . (folder) 10:34:52
.
├── delete-file1
├── delete-file2
├── delete-file3
├── keep-file1
└── keep-folder
'use strict'; | |
import React, { PureComponent, useState, useEffect } from 'react'; | |
import { AppRegistry, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; | |
import { RNCamera } from 'react-native-camera'; | |
import Permissions from 'react-native-permissions'; | |
const CameraApp = () => { | |
let [flash, setFlash] = useState('off') | |
let [zoom, setZoom] = useState(0) | |
let [autoFocus, setAutoFocus] = useState('on') |
import React from 'react'; | |
import { Button } from 'antd'; | |
import styled from 'styled-components'; | |
import { storiesOf } from '@storybook/react'; | |
const stories = storiesOf('Benchmarks', module); | |
const StyledButton = styled(Button)` | |
&& { | |
display: block; |
// injects the script in the body of the document. | |
// returns a promise that gets resolves once the script has been loaded in the document | |
export const injectScript = (url, document = window.document) => { | |
const script = document.createElement('script'); | |
script.src = url; | |
script.type = 'text/javascript'; | |
script.async = true; | |
const body = document.getElementsByTagName('body')?.[0] ?? null; | |
if (body === null) { |