Skip to content

Instantly share code, notes, and snippets.

@joshdholtz
joshdholtz / ATinySampleApp.swift
Last active March 29, 2024 23:27
Super basic SwiftUI app (70 lines of code) with paywall using RevenueCat
import SwiftUI
import RevenueCat
struct Constants {
static let apiKey = "<your_api_key>" // Will look like: appl_bunchofotherstuffhere
static let entitlementName = "<your_entitlement_name>" // I use something like "pro"
}
@main
struct ATinySampleApp: App {
import UIKit
struct ComplexObject: Decodable {
let timestamp: Int
let identifier: String
}
extension ComplexObject {
enum CodingKeys: String, CodingKey {
case timestamp
@cmaneu
cmaneu / slackWeather.js
Last active January 19, 2024 19:59
Slack slackbot send weather forecast
var request = require("request");
// The Cities IDs can be found on openweathermap.org (make a search, and look the URI)
var cities = [2988507, 5391959];
var slackBotUri = ""; // TODO: Complete
request("http://api.openweathermap.org/data/2.5/group?id="+cities.join(',')+"&units=metric ", function(error, response, body) {
// Maybe we can handle this differently/better ?
if(error != null)
return;