Skip to content

Instantly share code, notes, and snippets.

View DiyRex's full-sized avatar
😉
const Smile = require('Happy');

Devin Dissanayaka DiyRex

😉
const Smile = require('Happy');
View GitHub Profile
@DiyRex
DiyRex / worker.js
Created August 5, 2024 06:07
Cloudflare Webhook to Trigger Github Workflow using Telegram Bot
// Add the following variables:
// ENV_BOT_TOKEN: Your bot token from BotFather.
// ENV_BOT_SECRET: A random secret for webhook verification.
// ENV_GITHUB_TOKEN: Your GitHub personal access token.
// ENV_WORKFLOW_NAME: Workflow file name inside main branch (deploy.yml)
// ENV_GITHUB_REPO: Your GitHub repository in the format owner/repo.
// After deploy run https://<yout-url>/registerWebhook
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
@DiyRex
DiyRex / code-server.sh
Created June 24, 2024 10:02
Deploy VS Code Server in Localhost
#!/bin/bash
# Variables (Change with your preferences)
USER="yourusername"
PASSWORD="yourpassword"
PORT=4500
# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
echo "Please run this script as root."