Skip to content

Instantly share code, notes, and snippets.

---
import "../../base.css";
let errorMessage: string | null = null;
// Initialize edit, del, phone, and email values based on URL parameters.
const edit = Astro.url.searchParams.get("edit");
const search = Astro.url.searchParams.get("q");
const del = Astro.url.searchParams.get("delete");
// Define a data schema for your main form.
interface FormSchema {
type: string;
#!/bin/bash
# Retrieve the public IP address of the EC2 instance
public_ip=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
pm2 ls | awk '{print $4}' | grep -v 'git' | xargs -I{} pm2 delete {}
pm2 restart git
pm2 delete kloun
pm2 delete eziktok
# del volumes
# Update the A record in Route 53 userz.net
@arpecop
arpecop / server.js
Created June 25, 2022 21:36
server.js
/* eslint-disable no-underscore-dangle */
/* eslint-disable camelcase */
const puppeteer = require('puppeteer')
const fs = require('fs').promises
const minimal_args = [
'--autoplay-policy=user-gesture-required',
'--disable-background-networking',
'--disable-background-timer-throttling',
'--disable-backgrounding-occluded-windows',
const height = [0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1].map(x => x + 1)
// ▣ - column
// ▢ - air
// ▧ - water level
const min = Math.min(...height)
const max = Math.max(...height)
const maxHeight = Math.max(...height)
const mesh = height => {
const res = []
const staticPages = fs
.readdirSync('pages')
.filter(
staticPage =>
!['_app.js', '_document.js', '_error.js', 'sitemap.xml.js'].includes(
staticPage
)
)
.map(staticPagePath => {
return `${baseUrl}/${staticPagePath}`
[
{
url: 'https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4',
title: 'video 1',
description: 'description 1',
thumbnail: 'https://via.placeholder.com/350x150',
},
{
url: 'http://d23dyxeqlo5psv.cloudfront.net/big_buck_bunny.mp4',
title: 'video 2',
const fetch = require('node-fetch');
const insert = (json, table) => {
fetch('http://localhost/v2/query', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-hasura-admin-secret': 'test',
},
body: JSON.stringify({
type: 'insert',
import React, { useEffect, useState } from 'react'
import { BrowserRouter, Switch, Route } from 'react-router-dom'
import { match } from 'react-router'
import { Layout, Menu, Table, Button, Input } from 'antd'
import { DownloadOutlined } from '@ant-design/icons'
import useLocalStorage from './hooks/localstorage'
const { Column, ColumnGroup } = Table
const { Header, Content, Footer } = Layout
interface Identifiable {
id: string
SELECT
coalesce(
json_agg(
"root"
ORDER BY
"root.pg.created_at" DESC NULLS FIRST
),
'[]'
) AS "root"
FROM
async function postData(url = "", data = {}) {
// Default options are marked with *
const response = await fetch(url, {
method: "POST", // *GET, POST, PUT, DELETE, etc.
mode: "cors", // no-cors, *cors, same-origin
cache: "no-cache", // *default, no-cache,
credentials: "same-origin", // include,
headers: {
"Content-Type": "application/json",
"x-hasura-admin-secret": "secret",