Skip to content

Instantly share code, notes, and snippets.

View benedictbartsch's full-sized avatar

Benedict Bartsch benedictbartsch

View GitHub Profile
@benedictbartsch
benedictbartsch / featurecat.swift
Last active September 16, 2021 13:44
Example implementation of FeatureCat's public board in an iOS UIKit app. It has all the code required in one single file for tutorial purposes - but it works.
import Foundation
import WebKit
import UIKit
// This is just an example ViewController that has been stripped of all code except the one relevant for FeatureCat.
class AnyViewController: UIViewController {
// Excluded here: All the other code you need for your UI.
// Return the WebView in whatever way suits you best (segues, etc.).
@benedictbartsch
benedictbartsch / postcard.rb
Last active July 8, 2021 19:21
A simple Ruby class that sends a message to a Telegram bot and posts to a specific chat. Use `Postcard.new($yourMessage).deliver` to send a message to Telegram.
require 'net/https'
# Sends a message to a Telegram bot and specific chat as defined in the environment variables.
class Postcard
def initialize(message)
@message = message
@chat_id = ENV['POSTCARD_CHAT_ID']
@bot_token = ENV['POSTCARD_BOT_TOKEN']
end