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
@api_blueprint.route("/api/endpoint") | |
def get_endpoint(): | |
# TODO: There is no need to write the path again | |
response = requests.get("https://new.hostname.com/api/endpoint", params=request.args) | |
response = jsonify(response.json()) | |
return response | |
@api_blueprint.route("/api/endpoint", methods=["POST"]) | |
def post_endpoint() | |
# TODO: Implement proxied request |
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 { useState, useRef, useEffect } from 'react'; | |
import { BehaviorSubject } from 'rxjs'; | |
export default function useObservableState<TElement>(initialValue: TElement) { | |
const observableRef = useRef(new BehaviorSubject(initialValue)); | |
const [value, setValue] = useState(initialValue); | |
useEffect(() => { | |
observableRef.current.next(value); | |
}, [value]); |
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, useState, useRef, useCallback } from 'react'; | |
export default function useRefState<TValue>(initialState: TValue) { | |
const [state, setInnerState] = useState(initialState); | |
const ref = useRef(initialState); | |
const setState = useCallback((value: TValue) => { | |
setInnerState(value); | |
ref.current = value; | |
}, []); |
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 { useState, useCallback } from 'react'; | |
export default function useArrayState<TElement>(initialArr: Array<TElement>) { | |
const [arr, setArr] = useState(initialArr); | |
const setArrElement = useCallback((index: number, value: TElement) => { | |
if (!(index > -1)) return; | |
setArr((prevArr) => { | |
const arrayCopy = [...prevArr]; |
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
fetch('/assets/app.bundle.js') | |
.then(response => { if (response.status > 200) throw new Error('not found'); return response.arrayBuffer() }) | |
.then(async (buffer) => { | |
const hashBuffer = await crypto.subtle.digest('SHA-256', buffer); | |
const hashArray = Array.from(new Uint8Array(hashBuffer)); | |
return hashArray.map(b => ('00' + b.toString(16)).slice(-2)).join(''); | |
}) | |
.then(console.log) |
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
{ | |
"telemetry.enableTelemetry": false, | |
"explorer.openEditors.visible": 0, | |
"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe", | |
"files.eol": "\n", | |
"workbench.colorTheme": "Night Owl", | |
"git.enableSmartCommit": true, | |
"extensions.ignoreRecommendations": false, | |
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
POLÍTICA DE PRIVACIDAD | |
El presente Política de Privacidad establece los términos en que usa y protege la información que es proporcionada por sus usuarios al momento de utilizar su sitio web. Esta compañía está comprometida con la seguridad de los datos de sus usuarios. Cuando le pedimos llenar los campos de información personal con la cual usted pueda ser identificado, lo hacemos asegurando que sólo se empleará de acuerdo con los términos de este documento. Sin embargo esta Política de Privacidad puede cambiar con el tiempo o ser actualizada por lo que le recomendamos y enfatizamos revisar continuamente esta página para asegurarse que está de acuerdo con dichos cambios. | |
Información que es recogida | |
Nuestro sitio web podrá recoger información personal por ejemplo: Nombre, información de contacto como su dirección de correo electrónica e información demográfica. Así mismo cuando sea necesario podrá ser requerida información específica para procesar algún pedido o realizar una entrega o facturación. | |
Uso |
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
// functions/income/counter.function.js | |
'use strict' | |
const functions = require('firebase-functions') | |
const admin = require('firebase-admin') | |
// Prevent firebase from initializing twice | |
try { admin.initializeApp(functions.config().firebase) } catch (e) {} |
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
^!Left::Media_Prev | |
^!Right::Media_Next | |
^!DOWN::Media_Play_Pause | |
# run shell:common startup and paste the file here to enable this scripts on startup | |
# Ctrl + Alt + Left: Previous | |
# Ctrl + Alt + Right: Next | |
# Ctrl + Alt + Down: Pause |
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
env=~/.ssh/agent.env | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { | |
(umask 077; ssh-agent >| "$env") | |
. "$env" >| /dev/null ; } | |
agent_load_env |
NewerOlder