Skip to content

Instantly share code, notes, and snippets.

View rayhanadev's full-sized avatar
👋

Ray rayhanadev

👋
View GitHub Profile
@rayhanadev
rayhanadev / astro.mjs
Created March 10, 2023 17:27
Koa-Astro SSR Server with Compression
import { handler as middleware } from '../dist/server/entry.mjs';
export const handler = async (req, res, next) => {
const response = await middleware(req, res, next);
return response;
};
@rayhanadev
rayhanadev / examples.md
Created November 8, 2021 23:59
Crosis4Furrets Examples

Crosis4Furrets Examples

FS Snapshot Uptime

import { Client } from 'crosis4furrets';

const client = new Client(process.env.TOKEN, 'replId');

await client.connect();
await client.persist();
@rayhanadev
rayhanadev / file-structure.txt
Last active July 21, 2021 17:04
The best Gulpfile for using React (JSX) and Sass with an Express Server.
src/
┣╸server/
┃ ┗╸index.js
┣╸client/
┃ ┣╸public/
┃ ┃ ┣╸styles/
┃ ┃ ┃ ┗╸ *.scss
┃ ┃ ┗╸js/
┃ ┃ ┣╸components/
┃ ┃ ┃ ┗╸*.js
@rayhanadev
rayhanadev / Run-GraphQL.js
Last active July 4, 2021 15:11
ReplAPI.it GraphQL Function
import { lightfetch } from 'lightfetch-node';
// You will need your connect.sid cookie for authenticated requests
const { CONNECT_SID } = process.env;
const headers = {
'X-Requested-With': 'Your-Username',
Referrer: 'https://replit.com/',
};
/*
@rayhanadev
rayhanadev / Interval-Based-Function-Caller.js
Last active July 4, 2021 15:01
Interval Based Function Caller
function startInterval() {
(function loop() {
var now = new Date();
// Set the time here
if (now.getDay() === 0 && now.getHours() === 0 && now.getMinutes() === 59) {
/* Place function to execute here */
}
now = new Date();
var delay = 60000 - (now % 60000);
setTimeout(loop, delay);