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
<script src="jquery-1.6.1.min.js"></script> | |
<script src="socket.io/socket.io.js"></script> | |
<script> | |
var socket = new io.Socket(null,{port:8080}); | |
socket.connect(); | |
socket.on('message',function(obj){ | |
switch(obj.tipo){ | |
case 'imagen': | |
img = document.getElementById('stream'); | |
img.src=""; |
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
export actions = { | |
prepyment: async ({ request }) => { | |
const formData = await request.formData() | |
const price = formData.get('price') | |
const email = formData.get('email') | |
const url = await generateCheckout(price, email) | |
return { success: true, url } | |
} | |
} |
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 App() { | |
function [currentWeather, setCurrentWeather] = useState() // No hay estado al principio | |
React.useEffect(() => { | |
api.local_current("AR") | |
.then(data => setCurrentWeather(data)) | |
.catch(error => { | |
console.error(error) | |
}) | |
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
## Set credentials | |
from dotenv import load_dotenv | |
load_dotenv() | |
import cloudinary | |
import cloudinary.uploader | |
import cloudinary.api | |
import pprint | |
pp = pprint.PrettyPrinter(indent=2) |
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
export const stringToPastelColour = function (str: string): string { | |
let hash = 0; | |
for (let i = 0; i < str.length; i++) { | |
hash = str.charCodeAt(i) + ((hash << 6) - hash); | |
hash = hash & hash; // Convert to 32bit integer | |
} | |
const shortened = hash % 360; | |
return 'hsl(' + shortened + ',100%,35%)'; | |
}; |
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
/* | |
* shameless plug: https://www.escuelafrontend.com/articulos/metodos-de-arreglos | |
*/ | |
const arr = [1,2,3,] | |
const failureMessages = [] | |
arr.forEach((item) => { | |
failureMessages.push("<li>${item}</li>") |
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
/* | |
* App.jsx main entry | |
*/ | |
const SomethingElse = React.lazy(() => import('pages/SomethingElse')); | |
function App() { | |
return ( | |
<BrowserRouter> | |
<Switch> | |
<Route path="/" component={Home} /> | |
<Route path="/somethinElse" component={SomethingElse} /> |
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 createSharingImage = ({ cloudName, text }) => { | |
const imageTransformations = [ | |
'w_1200', | |
'h_627', | |
'c_fill', | |
'q_auto', | |
'f_auto' | |
].join(',') | |
const textTransformations = [ | |
'w_600', |
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 * as React from 'react'; | |
import { send } from 'xstate/lib/actionTypes'; | |
import { Info } from './components.styled'; | |
import { StatusMachineContext } from './StatusMachineProvider'; | |
import { useSelectors } from './useSelectors'; | |
export const InfoComponent = () => { | |
const { isQueue, isInProgress, isCancelled, isBid } = useSelectors(); | |
const { statusService } = React.useContext(StatusMachineContext); |
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 whoAmI = { | |
work: "Senior Engineer at Clevertech", | |
egghead: "https://matiasfha.dev/egghead", | |
escuelafrontend: "https://escuelafrontend.com", | |
auth0: "Ambassador", | |
cloudinary: "Media Developer Expert", | |
AWS: "Communityu Builder", | |
"Cafe con Tech": "https://matiasfha.dev/podcast", | |
"Control Remoto": "https://controlremoto.io", | |
"Site": "https://matiashernandez.dev", |
NewerOlder