Skip to content

Instantly share code, notes, and snippets.

View tayyebi's full-sized avatar
📿
Grateful

MohammadReza Tayyebi tayyebi

📿
Grateful
View GitHub Profile
@tayyebi
tayyebi / telegram_to_email.gs
Last active January 1, 2024 20:38
Google Apps Script bot, to forward fetched messages from Telegram to E-Mail.
/*
* This code includes contributions made by Bing AI.
*
* Copyright (c) [2024] [Mohammad Reza Tayyebi]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@tayyebi
tayyebi / cnf.gs
Last active December 30, 2023 11:34
A Telegram bot written in Google Apps script, to fetch messages from RSS and send them to channels with image and markdown support.
function getBot() {
return '680616:AAOWy-Eows';
}
#property copyright "Tayyebi"
#property link "https://tradingview.com/u/tayyebi"
#property version "1.00"
int OnInit()
{
Comment("Started " + Symbol());
return(INIT_SUCCEEDED);
}
@tayyebi
tayyebi / cal.ods
Last active October 15, 2021 13:14
My Calendar
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © tayyebi
//@version=4
study(shorttitle="TYYI", title="Tayyip Strategy", overlay=true, resolution="")
// strategy("Tayyebi's Strategy", overlay=true, margin_long=1, margin_short=1)
// BB
length = input(20, minval=1)
@tayyebi
tayyebi / HackerNews.gs
Created May 5, 2021 06:01
HackerNews Api Client Based on Google Apps Script
/**
*
* This program simply creats an Google Spreadsheet
* document stored in Google Drive, and checks for
* new items in hacker news, then stores them inside
* the document file.
*
* Please run the `SyncDataSheet()` method in order
* to make it done. Or add it to cron triggers.
*
@tayyebi
tayyebi / ClassicCommentSnippet.code-snippets
Last active January 5, 2021 18:05
Xml Comment (Microsoft Standard) Snippet for codes documentation.
{
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
@tayyebi
tayyebi / FilterMastodonToots.js
Created October 6, 2020 14:28
To filter hashtag #هزلیات from Mastodon.
var childDivs = document.getElementsByClassName('status');
for( i=0; i< childDivs.length; i++ )
{
var childDiv = childDivs[i];
if (childDiv.textContent.includes("#هزلیات")) {
childDiv.style.display='none';
}
}
@tayyebi
tayyebi / Makefile
Created June 28, 2020 05:47 — forked from PhirePhly/Makefile
A crazy simple SMTP server, for educational purposes only.
default:
cc ccsmtp.c -o ccsmtpd -lpthread
<?php
// Find the domain name
$domain = $_SERVER['HTTP_HOST'];
$domain_alias = 'www.' . $_SERVER['HTTP_HOST'];
// Find root URL
$directory = rtrim ( ltrim ( __DIR__ , $_SERVER["DOCUMENT_ROOT"] ) , "core" );
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
$root = $actual_link . '/' . $directory;