This file contains hidden or 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
def is_prime(n): | |
prime = False | |
for divisor in range(2, n): | |
if n % divisor == 0: | |
return prime | |
else: | |
continue | |
prime = True | |
return prime |
This file contains hidden or 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
big_num = '7316717653133062491922511542828064444866452387493035890' | |
big_num_len = len(big_num) | |
list_of_products = [] | |
def multiply_adjacents(adj_num): | |
product = 0 | |
first_pos = True | |
for element in adj_num: |
This file contains hidden or 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
def find_anagrams(list_of_words, word): | |
sliced_word = [] | |
sliced_word += word | |
list_of_anagrams = [] | |
for element in list_of_words: | |
sliced_element = [] | |
sliced_element += element | |
if sorted(sliced_element) == sorted(sliced_word): | |
list_of_anagrams.append(element) | |
return list_of_anagrams |
This file contains hidden or 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
04cd29cfde9d461c722d1b0f482c054367972037dc1982d7b5e7ec46bdb4864679a240f616b9cafbe2a99a389a0f7d76daf5132e27546ea071a80e6d1e35b62955;nortss |
This file contains hidden or 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 { ApolloServer, gql } = require("apollo-server-lambda"); | |
const AWS = require("aws-sdk"); | |
const dynamoDb = new AWS.DynamoDB.DocumentClient(); | |
const typeDefs = gql` | |
type Recipe { | |
recipeId: Int | |
recipeName: String | |
description: String |
This file contains hidden or 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
# Welcome to Serverless! | |
# | |
# This file is the main config file for your service. | |
# It's very minimal at this point and uses default values. | |
# You can always add more config options for more control. | |
# We've included some commented out config examples here. | |
# Just uncomment any of them to get that config option. | |
# | |
# For full config options, check the docs: | |
# docs.serverless.com |
This file contains hidden or 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, { Component } from "react"; | |
import { | |
StyleSheet, | |
View, | |
Text, | |
Image, | |
ImageBackground, | |
TouchableHighlight, | |
StyleProp, | |
TextStyle, |
This file contains hidden or 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 { mount, shallow } from 'enzyme'; | |
import { View, TextInput, Image, Text } from 'react-native'; | |
import toJSON from 'enzyme-to-json'; | |
import { MockedProvider } from 'react-apollo/test-utils'; | |
import renderer from 'react-test-renderer'; | |
import wait from 'waait'; | |
import { GET_RECIPIES_QUERY } from '../src/graphql/queries'; | |
import RecipeListScreen, {RecipeListScreenWithoutHocs} from '../src/screens/RecipeListScreen'; |
This file contains hidden or 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-app-polyfill/ie9"; // For IE 9-11 support | |
import "react-app-polyfill/ie11"; // For IE 11 support | |
import "./polyfill"; | |
import React, { Component } from "react"; | |
import ReactDOM from "react-dom"; | |
import "./index.css"; | |
import App from "./App"; | |
import * as serviceWorker from "./serviceWorker"; | |
import Amplify, { Auth } from "aws-amplify"; | |
import { Authenticator, Greetings, SignUp, SignIn } from "aws-amplify-react"; |
This file contains hidden or 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
//ANSWER ======== A | |
/* Notes: | |
https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API | |
Here we can find in which cases we should expect a catch to be raised in the promise and when not. Seems like unless | |
there is a problem with the connection or bad formed url, we should expect an error to not be raised. Just an status code that reflects that | |
/* | |
const urls = [ | |
"http://randomurl.com/subpath1", |
OlderNewer