async function processWebhookInvoiceSuccess(event: Stripe.Invoice) {
console.log(JSON.stringify(event, null, 2));
await prisma.user.update({
where: { id: user.id },
data: {
latestInvoiceStart: event.period_start,
latestInvoiceEnds: event.period_end,
},
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 stringToNumber(str: string) { | |
str = str.trim() | |
if (/[^\d]/.test(str)) { | |
throw new Error('Deve conter apenas numeros') | |
} | |
return Array.from(str).reverse().reduce((acc, cur, idx) => { | |
let val = (cur.charCodeAt(0) - 48) | |
return acc + (val * 10 ** idx) |
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
document.addEventListener('click', e => { | |
if(e.target.tagName.toUpperCase() == 'A') { | |
e.stopPropagation() | |
e.preventDefault() | |
var data_container=jquery(e.target).attr('data-container'); | |
if(data_container){ | |
var title=jquery(e.target).attr('title'); | |
var url=jquery(e.target).attr('href'); | |
jquery('body').html(''); | |
path=url.split('/')[1]; |
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
from flask import Flask, request, make_response | |
app = Flask(__name__) | |
@app.route('/') | |
def visit_counter(): | |
visits = int(getattr(request.cookies, 'visits', 0)) + 1 | |
msg = f''' | |
<h1> |
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
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World em Vue3</title> | |
<script type="text/javascript" src="https://unpkg.com/vue@3"></script> | |
</head> | |
<body> | |
<div id="app"></div> | |
<script type="text/javascript"> |
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
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World em Vue3</title> | |
<script type="text/javascript" src="https://unpkg.com/vue@3"></script> | |
</head> | |
<body> | |
<div id="app"> | |
<input type="text" v-model="nome" > |
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
<!DOCTYPE html> | |
<html lang="pt"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello World em Vue3</title> | |
<script type="text/javascript" src="https://unpkg.com/vue@3"></script> | |
</head> | |
<body> | |
<div id="app"> | |
<h1>{{ message }}</h1> |
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 test = function () { | |
if (true) { | |
const stringTest = 'hello' | |
console.log(stringTest) | |
} | |
console.log(stringTest) | |
} | |
test() |
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
let test = function () { | |
console.log(stringTest) | |
if (true) { | |
let stringTest = 'hello' | |
console.log(stringTest) | |
} |
NewerOlder