How to: Just copy tasks.rake into your project, replace ai-engine
with the name of your gem, and run!
app:tasks:release[your-gem-name,0.1.1]
- Based on this excellent article.
- Follow me on X for more Ruby content at https://x.com/alexrudall
How to: Just copy tasks.rake into your project, replace ai-engine
with the name of your gem, and run!
app:tasks:release[your-gem-name,0.1.1]
class GameChannel < ApplicationCable::Channel | |
def subscribed | |
game = Game.find(params[:id]) | |
stream_for game | |
end | |
end | |
## When the game state changes | |
GameChannel.broadcast_to(game, GameSerializer.render(game)) |
First and foremost you need to set the CORS configuration for your bucket. I'm a Java developer so here's the code I wrote using the AWS Java SDK v2 to define the CORS configuration for my R2 bucket. Alternatively you can also edit your bucket CORS configuration using Postman following the tutorial at https://kian.org.uk/configuring-cors-on-cloudflare-r2/
// update the config section here with your information first
String bucketName = "YOUR_BUCKET";
String accessKeyId = "YOUR_R2_ACCESS_KEY_ID";
String secretAccessKey = "YOUR_R2_SECRET_ACCESS_KEY";
String accountId = "YOUR_ACCOUNT_ID";
URI uri = new URI("https://" + accountId + ".r2.cloudflarestorage.com");
const header = `keyid="bf9b523f-dd65-48a2-9512-fb66ba6c3714", | |
algorithm="ed25519", | |
signature="KhgcM+Ywv+DnQj4gE+DqWfNTM2TG5wfRuFQZ/zW48ValZuCHEu1h95Uyldqe7I85sS/QliCiRAF5QfW8ZN2vAw==", | |
headers="(request-target) host date digest"` | |
// Parse the parameterized header into an object | |
const params = header.split(/,\s*/g) | |
.map(keyvalue => keyvalue.match(/(?<key>[^=]+)="(?<value>[^"]+)"/i)) | |
.map(matches => matches.groups) | |
.reduce( |
import http from "http"; | |
import https from "https"; | |
import { | |
AddressInfo, | |
} from "net"; | |
import { URL } from "url"; | |
const updateServer = "https://updates.yourserver.com/path/to/update/dir/without/trailing/slash"; | |
const updateAuth = `Basic ${Buffer.from("username:password").toString("base64")}` |
Copyright © 2021 Stephen Touset <[email protected]> | |
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 furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SO |
This recipe is a work in progress and has never been run as-is.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords | |
ActivityTweet | |
generic_activity_highlights | |
generic_activity_momentsbreaking | |
RankedOrganicTweet | |
suggest_activity | |
suggest_activity_feed | |
suggest_activity_highlights | |
suggest_activity_tweet |