Skip to content

Instantly share code, notes, and snippets.

View demndevel's full-sized avatar
:octocat:
meowing

demn demndevel

:octocat:
meowing
View GitHub Profile
@demndevel
demndevel / Installing osu!lazer.md
Last active October 30, 2021 09:20
How to install osu!lazer by bitedasher

Link to copr
Github

Commands to install: dnf copr enable bitedasher/osu-lazer dnf install osu-lazer

@demndevel
demndevel / tg-go-bot.txt
Created November 6, 2021 06:35
simple telegram bot written in golang by medium.com
package main
import (
"github.com/Syfaro/telegram-bot-api"
"log"
)
func main() {
// подключаемся к боту с помощью токена
bot, err := tgbotapi.NewBotAPI("ТОКЕН")
if err != nil {
@demndevel
demndevel / main.py
Created December 10, 2021 14:26
a telegram bot serving an html game
import telebot
bot = telebot.TeleBot("<bot token>")
@bot.callback_query_handler(func=lambda call: True)
def test_callback(call):
print(call)
bot.answer_callback_query(call.id, text="амогус", url="https://github.com/demndevel")
bot.infinity_polling()
using System.Text.Json.Serialization;
using System.Xml;
using Newtonsoft.Json;
namespace chatik;
class Message
{
public string Text = "";
public string Nickname = "";
}
@demndevel
demndevel / Sanitizer.cs
Created May 22, 2022 08:08
Sanitize filename c sharp
public class Sanitizer
{
public static string Sanitize(string name)
{
string invalidChars = System.Text.RegularExpressions.Regex.Escape( new string( System.IO.Path.GetInvalidFileNameChars() ) );
string invalidRegStr = string.Format( @"([{0}]*\.+$)|([{0}]+)", invalidChars );
return System.Text.RegularExpressions.Regex.Replace( name, invalidRegStr, "_" );
}
}
@demndevel
demndevel / RssController.cs
Created November 2, 2022 07:19
Rss feed in asp.net mvc core controller example
public class RssController : Controller
{
private readonly INoteRepository _notes;
public RssController(INoteRepository notes)
{
_notes = notes;
}
public ContentResult Rss()
{