This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Encapsulates a number of event handlers that should later | |
at some point be released. Useful for attaching blocks | |
of complex interactions to elements or to `document` and then detaching | |
them in bulk when the component/UI that they are serving is | |
unmounted or disconnected. | |
connect() { | |
this.evm = new EventListenerManager(); | |
// .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "async" | |
gem "ferrum" | |
gem "state_machines" | |
gem "breaker_machines" | |
gem "concurrent-ruby" | |
gem "nokogiri" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Calendar = Application("Calendar") | |
const calendarName = "My Calendar"; | |
const eventNamePrefix = "Amazing Project 123"; | |
var theCalendar = Calendar.calendars.whose({name: calendarName})[0] | |
var fromDate = new Date(2025, 4, 25) | |
var evts = theCalendar.events.whose( | |
{_and: [ | |
{summary: { _beginsWith: eventNamePrefix }}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def enter!(readonly: false) | |
Current.site = self | |
@inside = true | |
set_appsignal_tags! | |
@shardine = Shardine.new(connection_config_hash: database_config.merge(readonly:)) | |
@shardine.enter! | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "digest" | |
require "rack" | |
# This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database. | |
# ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable. | |
# | |
# What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant. | |
# If all the tenants are predefined, it can be done roughly so: | |
# | |
# ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This class encapsulates a unit of work done for a particular tenant, connected to that tenant's database. | |
# ActiveRecord makes it _very_ hard to do in a simple manner and clever stuff is required, but it is knowable. | |
# | |
# What this class provides is a "misuse" of the database "roles" of ActiveRecord to have a role per tenant. | |
# If all the tenants are predefined, it can be done roughly so: | |
# | |
# ActiveRecord::Base.legacy_connection_handling = false if ActiveRecord::Base.respond_to?(:legacy_connection_handling) | |
# $databases.each_pair do |n, db_path| | |
# config_hash = { | |
# "adapter" => 'sqlite3', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# <%= style_for_this_template do %> | |
# width: 128px; | |
# .caption { | |
# font-size: 12px; | |
# text-align: center; | |
# } | |
# <% end %> | |
# <div class="<%= css_class_for_this_template %>"> | |
# <div class="title">Hello!</div> | |
# </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
require "logger" | |
gemfile do | |
source 'https://rubygems.org' | |
gem "activerecord", "~> 6", require: "active_record" | |
gem "sqlite3", "~> 1.1" # This has to be of a version activerecord supports, so can't be 2.x | |
end | |
16.times do |n| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'bundler/inline' | |
gemfile do | |
source 'https://rubygems.org' | |
gem 'premailer' | |
gem 'nokogiri' | |
gem 'base64' | |
gem 'mail' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
.outlinerounded { | |
width: 1px; height: 1px; overflow: hidden; border: 1px solid gray; | |
} | |
</style> | |
</head> | |
<body> |
NewerOlder