Skip to content

Instantly share code, notes, and snippets.

@ervinstyle
ervinstyle / acme.php
Last active July 24, 2024 15:35
Hestiacp acme.sh api
<?php
ini_set('display_errors', 'on');
header('Content-type: text/plain');
$token = @$_POST['token'];
$cmd = @$_POST['cmd'];
$fulldomain = @$_POST['fulldomain'];
$value = @$_POST['value'];
$split_domain = explode('.', $fulldomain);
@ervinstyle
ervinstyle / sse.ts
Created July 16, 2024 13:45 — forked from atinux/sse.ts
SSE endpoint example with Nuxt 3
// ~/server/api/sse.ts
export default defineEventHandler(async (event) => {
if (!process.dev) return { disabled: true }
// Enable SSE endpoint
setHeader(event, 'cache-control', 'no-cache')
setHeader(event, 'connection', 'keep-alive')
setHeader(event, 'content-type', 'text/event-stream')
setResponseStatus(event, 200)
<template>
<time :datetime="date" :title="date">{{ timeago }}</time>
</template>
<script>
const units = [
{ max: 2760000, value: 60000, name: 'minute', short: 'm', past: 'a minute ago', future: 'in a minute' },
{ max: 72000000, value: 3600000, name: 'hour', short: 'h', past: 'an hour ago', future: 'in an hour' },
{ max: 518400000, value: 86400000, name: 'day', short: 'd', past: 'yesterday', future: 'tomorrow' },
{ max: 2419200000, value: 604800000, name: 'week', short: 'w', past: 'last week', future: 'in a week' },