Skip to content

Instantly share code, notes, and snippets.

@tcannonfodder
tcannonfodder / pull-to-refresh.js
Last active August 16, 2025 10:42
Pull to Refresh + Web Awesome workaround for iOS
import PullToRefresh from 'pulltorefreshjs';
var drawerOrPageShown = false
function afterShowEvent(event){
const element = event.target
if(element.tagName != "WA-PAGE" && element.tagName != "WA-DRAWER") {
return
}
@tcannonfodder
tcannonfodder / UrlNavigation.java
Created August 13, 2025 15:25
Median: Android Deep Linking causes infinite loop on launch
// java/co/median/android/UrlNavigation.java
// Around line 255
public boolean shouldOverrideUrlLoadingNoIntercept(final GoNativeWebviewInterface view, final String url,
@SuppressWarnings("SameParameterValue") final boolean noAction) {
// Called as part of the Intent fired from the App Launch, the `url` is: https://btvfit.stagepunchpass.com/classes
// ..
//
// check redirects
@tcannonfodder
tcannonfodder / example.txt
Last active August 13, 2025 14:48
Median Barcode Scanner cannot be closed on Google Pixel 7
This is a placeholder file so that the image can be uploaded
@tcannonfodder
tcannonfodder / application.html.erb
Created August 7, 2025 14:51
Web Awesome + Bundled CSS + Autoloader support + Rails + Rollup
<%= javascript_include_tag "webawesome", type: :module, defer: true, data: {webawesome: '/assets/webawesome-dist'} %>
@tcannonfodder
tcannonfodder / bundle-dates
Created July 15, 2025 18:01
A quick script you can use to get the release dates for all the gems in your gem file
#!/usr/bin/env ruby
require "open3"
require "debug"
require 'strscan'
require 'json'
require 'time'
bundle_list, _status = Open3.capture2e("bundle list")
# Showing how to set the request variant
def using_web_awesome?
if has_current_organization?
Flipper.enabled?(:web_awesome, current_organization)
else
Flipper.enabled?(:web_awesome, FlipperNoOrganizationActor.instance)
end
end
# frozen_string_literal: true
class PracticalFramework::Components::Pagination < Phlex::HTML
include Pagy::Frontend
include FontAwesomeHelpers::ViewHelpers
include Phlex::Rails::Helpers::FormWith
include Phlex::Rails::Helpers::ContentTag
include Phlex::Rails::Helpers::HiddenFieldTag
attr_reader :request
attr_accessor :pagy, :item_name, :i18n_key
// Example Swift configuration Actor; where the idea originated
actor WorkoutAppConfiguration {
static let instance = WorkoutAppConfiguration()
public let authenticationSessionSchema: String
public let HealthKitIdentifier: String
init(){
self.authenticationSessionSchema = Bundle.main.infoDictionary!["AUTHENTICATION_SERVICES_CALLBACK_SCHEME"] as! String
@tcannonfodder
tcannonfodder / .circleci-config.yml
Created January 26, 2024 01:24
Practical Framework code quality setup
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference
version: 2.1
rails_build: &rails_build
resource_class: small
docker:
- image: cimg/ruby:3.2-browsers
- image: cimg/postgres:16.1
environment:
@tcannonfodder
tcannonfodder / tiptap_document.rb
Created January 7, 2024 00:06
Tiptap document renderer using Phlex
# prototype extracted from the Practical Framework
class PracticalFramework::Components::TiptapDocument < Phlex::HTML
class UnknownNodeTypeError < StandardError; end
class UnknownMarkupTypeError < StandardError; end
module NodeRendering
def render_node(node:)
case node[:type].to_sym
when :text