Shared Hosting | Dedicated Hosting |
---|---|
1. Shared Resources | 1. Dedicated Resources |
2. Cheap than Dedicated | 2. Costlier than Dedicated |
3. Mostly no root access | 3. Root access available |
4. Less control over resources and software | 4. More control over resources and software |
5. No custom software as they are shared by everyone | 5. We can have custom software as there is no sharing |
6. Good for small projects/testing sites and web apps | 6. Good for large-scale and enterprise web apps and sites |
7. Most storage is Hard Disk Drives | 7. Storage is mostly SSD |
8. No Customizable environment | 8. Customizable environment |
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'; | |
const MyMemoComponent = React.memo(function MyComponent(props) { | |
return ( | |
<div> | |
<p>Value: {props.value}</p> | |
</div> | |
); | |
}); |
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, { PureComponent } from 'react'; | |
class MyPureComponent extends PureComponent { | |
render() { | |
return ( | |
<div> | |
<p>Value: {this.props.value}</p> | |
</div> | |
); | |
} |
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, { useState } from 'react'; | |
function ChildComponent(props) { | |
return ( | |
<p>Message from parent: {props.message}</p> | |
); | |
} | |
function ParentComponent() { | |
const [parentMessage, setParentMessage] = useState("Initial message"); |
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'; | |
function Greeting(props) { | |
return ( | |
<h1>Hello, {props.name}!</h1> | |
); | |
} | |
function ParentComponent() { | |
const name = "Alice"; // Example of data that could be dynamic |
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, { useState } from 'react'; | |
function MyComponent() { | |
const [count, setCount] = useState(0); | |
const incrementCount = () => { | |
setCount(prevCount => prevCount + 1); // Use functional update for correct state updates | |
}; | |
return ( |
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
<script src="./example.js"></script> | |
<script> | |
async function someMethod() { | |
const res = window.Buffer.from('somestring'); | |
} | |
</script> |
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
vote_from='michelangelo3' vote_to='dotwin1981' weight=25% | |
vote_from='michelangelo3' vote_to='ozelot47' weight=100% | |
vote_from='hornet-on-tour' vote_to='michelangelo3' weight=50% | |
vote_from='jeenger' vote_to='michelangelo3' weight=100% | |
vote_from='ozelot47' vote_to='michelangelo3' weight=25% | |
vote_from='michelangelo3' vote_to='elkezaksek' weight=100% | |
vote_from='dotwin1981' vote_to='michelangelo3' weight=100% | |
vote_from='jeenger' vote_to='michelangelo3' weight=25% | |
vote_from='michelangelo3' vote_to='elkezaksek' weight=25% | |
vote_from='michelangelo3' vote_to='ozelot47' weight=100% |
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
#author @tekraze | |
import falcon | |
import requests | |
class Hello: | |
def on_get(self, req, resp): | |
# we just send back a string here | |
resp.media = 'hello' |
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
FROM python:3.11.0a3-alpine3.15 | |
EXPOSE 8000 | |
# Install gunicorn & falcon | |
RUN pip install gunicorn requests falcon --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org | |
# Add demo app | |
COPY ./app /app | |
WORKDIR /app |
NewerOlder