Skip to content

Instantly share code, notes, and snippets.

View f1729's full-sized avatar
Everything is possible!

Luis f1729

Everything is possible!
  • Peru
View GitHub Profile
@f1729
f1729 / _middleware.ts
Created November 9, 2022 20:36 — forked from mtt87/_middleware.ts
Add password protection to any Vercel website, save $150/month.
import { addYears } from 'date-fns'
import { NextRequest, NextResponse } from 'next/server'
function middleware(req: NextRequest) {
if (req.nextUrl.pathname.startsWith('/api')) {
return NextResponse.next()
}
if (process.env.VERCEL_ENV !== 'preview') {
return NextResponse.next()
http://jsfiddle.net/e5okd9g2/1/
@f1729
f1729 / machine.js
Last active May 22, 2020 13:09
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
const getHitAndBlow = (entry, mirror, hit, blow) => {
const first = Object.keys(entry)[0];
if (first === undefined) return { hit, blow };
const { [first]: __, ...newEntry } = entry;
if (mirror[first]) {
if (mirror[first] === entry[first]) {
const { [first]: ___, ...newMirror } = mirror;
// This problem was asked by Facebook.
// We have some historical clickstream data gathered from our site anonymously using cookies.
// The histories contain URLs that users have visited in chronological order.
// Write a function that takes two users' browsing histories as input and returns
// the longest contiguous sequence of URLs that appear in both.
// For example, given the following two users' histories:

Proyecto X (Backend)

Proyecto X es una tienda tipo mercado libre donde los usuarios pueden subir sus productos y venderlos.

Fundamentos de un API (4h)

  • Uso de los verbos GET, POST, PUT, DELETE para interactuar con el API sobre el protocolo HTTP.
  • Status code: 200, 201, 404, 501.
  • Explorar a fondo el diseño del modelo request y response.

https://medium.com/@perrysetgo/what-exactly-is-an-api-69f36968a41f

Clase 1 / 03-02-19 Pantalla roja VNC VIEWER pc-402-01 ->conectar ->si pass - lima1902 teamviewer ->conexion remota PROF: Nery Panebra Sivirich npanebra@gmail.com 1-Requerimientos de informacion Entidad - objeto real o abstracto(sujeto)

{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme",
"highlight_line": true,
"indent_guide_options":
[
"draw_normal",
"draw_active"
],
@f1729
f1729 / power.js
Created September 18, 2018 03:22
function power(x , y) {
var base = x;
if ( y < 0 ) {
base = 1 / x;
y = -1*y;
}
var coeff = 1;
while (y > 1) {
if (y%2 == 0) {
base *= base;