Skip to content

Instantly share code, notes, and snippets.

View strzibny's full-sized avatar
🏠
Working from home

Josef Strzibny strzibny

🏠
Working from home
View GitHub Profile
@strzibny
strzibny / hotwire-native-oauth.md
Created March 1, 2026 05:02 — forked from yshmarov/hotwire-native-oauth.md
hotwire-native-oauth.md

OAuth in Hotwire Native iOS apps

Google and Apple block OAuth from embedded web views (WKWebView) with disallowed_useragent. This guide shows how to make OAuth work in a Hotwire Native iOS app using ASWebAuthenticationSession — Apple's purpose-built API for OAuth — with a path configuration rule and token handoff.

The approach uses zero bridge components. It works with any OmniAuth provider (Google, Apple, Facebook, etc.) and extends to social account linking (YouTube, TikTok, etc.) where the user is already signed in.

How it works

┌─────────────┐     ┌──────────────────────────┐     ┌─────────┐     ┌──────────┐
@strzibny
strzibny / keymap.json
Created June 21, 2024 07:21 — forked from joeldrapper/keymap.json
My Zed Config
[
{
"context": "Editor",
"bindings": {
"alt-up": "editor::SelectLargerSyntaxNode",
"alt-down": "editor::SelectSmallerSyntaxNode",
"ctrl-cmd-up": "editor::MoveLineUp",
"ctrl-cmd-down": "editor::MoveLineDown"
}
}
https://jennamolby.com/how-to-use-cookies-to-capture-url-parameters/
// Parse the URL
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)");
var results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
import { Controller } from 'stimulus';
import React from 'react';
import ReactDOM from 'react-dom';
import AppContainer from 'components/core/AppContainer';
export default class extends Controller {
connect() {
const Component = window.ReactComponents[this.data.get('component')];
let props = this.data.get('props') || {};
if (typeof props === 'string') {
@strzibny
strzibny / job_scheduler_using_ractor.rb
Created September 25, 2020 11:34 — forked from GustavoCaso/job_scheduler_using_ractor.rb
Simple implementation for a job scheduler using ruby Ractor primitive
require 'optparse'
require 'json'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'redis'
gem 'oj'
end
@strzibny
strzibny / Gemfile
Created June 25, 2020 03:48 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@strzibny
strzibny / stimulus.md
Created October 26, 2018 17:33 — forked from mrmartineau/stimulus.md
Stimulus cheatsheet
@strzibny
strzibny / todos_reducer.rb
Created January 27, 2018 18:14
Example todo reducer
todos_reducer = -> (state, action) {
state ||= []
case action[:type]
when 'add'
state.push(action[:todo])
when 'remove'
state.remove(action[:todo])
else
state
@strzibny
strzibny / combine_reducers.rb
Created January 27, 2018 18:12
Combining reducers into one
class ReduxStore
def self.combine_reducers(reducers)
-> (state, action) {
state ||= {}
reducers.reduce({}) { |next_state, (key, reducer)|
next_state[key] = reducer.call(state[key], action)
next_state
}
}