Skip to content

Instantly share code, notes, and snippets.

View raymelon's full-sized avatar
👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋

Raymel raymelon

👋
Integrating AI for businesses. Want your AI built? Say Hi https://02ai.dev 👋
View GitHub Profile
@thgaskell
thgaskell / README.md
Last active August 17, 2025 05:25
Claude Code + Aider MCP Server + GitHub Copilot Provider
if (new URLSearchParams(window.location.search).get('portal')) {
// <create start portal>
// Create portal group to contain all portal elements
const startPortalGroup = new THREE.Group();
startPortalGroup.position.set(SPAWN_POINT_X, SPAWN_POINT_Y, SPAWN_POINT_Z);
startPortalGroup.rotation.x = 0.35;
startPortalGroup.rotation.y = 0;
// Create portal effect
@raymelon
raymelon / how_to_get_telegram_chat_id.md
Created August 8, 2024 18:33 — forked from nafiesl/how_to_get_telegram_chat_id.md
How to get Telegram Bot Chat ID

How to get Telegram Bot Chat ID

Create a Telegram Bot and get a Bot Token

  1. Open Telegram application then search for @BotFather
  2. Click Start
  3. Click Menu -> /newbot or type /newbot and hit Send
  4. Follow the instruction until we get message like so
    Done! Congratulations on your new bot. You will find it at t.me/new_bot.
    
@KristofferEriksson
KristofferEriksson / useUndo.ts
Created January 31, 2024 11:34
A React hook that enhances your components with powerful undo/redo functionality
import { useCallback, useEffect, useRef, useState } from "react";
interface UseUndoHook<T> {
value: T;
onChange: (newValue: T) => void;
undo: () => void;
redo: () => void;
clear: () => void;
canUndo: boolean;
canRedo: boolean;
@HirbodBehnam
HirbodBehnam / google-form-to-tg.gs
Last active May 22, 2025 11:28
A google script to send submitted form results to a telegram bot
// Inspired by https://github.com/Iku/Google-Forms-to-Discord
const BOT_API = "YOUT_BOT_API";
const CHAT_ID = "CHAT_ID";
function onSubmit(e) {
var form = FormApp.getActiveForm();
var allResponses = form.getResponses();
var latestResponse = allResponses[allResponses.length - 1];
var response = latestResponse.getItemResponses();
var result = "";
@kluu1
kluu1 / app.js
Last active April 16, 2020 15:41
app.get('/posts', async (req, res) => {
// destructure page and limit and set default values
const { page = 1, limit = 10 } = req.query;
try {
// execute query with page and limit values
const posts = await Posts.find()
.limit(limit * 1)
.skip((page - 1) * limit)
.exec();
@raymelon
raymelon / postman_save_response_to_an_enviroment_variable.js
Last active September 13, 2023 14:41
postman save response to an enviroment variable
// on Tests tab, enter these
var jsonData = pm.response.json();
if (jsonData["response_field_key"])
pm.environment.set("ENV_VARIABLE_KEY", jsonData.access_token);
@shahnawaz
shahnawaz / barcode-mask-example-3.jsx
Last active June 18, 2024 05:01
react-native-barcode-mask example usage
import React from "react";
import {
Text,
View,
Item,
Icon,
Input,
Button
} from 'native-base';
import { KeyboardAvoidingView } from "react-native";
@AllanPooley
AllanPooley / moment-greetings.js
Created October 9, 2018 09:59
Time based user greetings (Good Morning, Afternoon, Evening) using moment.js
getGreetingTime = (currentTime) => {
if (!currentTime || !currentTime.isValid()) { return 'Hello'; }
const splitAfternoon = 12; // 24hr time to split the afternoon
const splitEvening = 17; // 24hr time to split the evening
const currentHour = parseFloat(currentTime.format('HH'));
if (currentHour >= splitAfternoon && currentHour <= splitEvening) {
// Between 12 PM and 5PM
return 'Good afternoon';