Skip to content

Instantly share code, notes, and snippets.

View KonnorRogers's full-sized avatar

Konnor Rogers KonnorRogers

View GitHub Profile
@amirrajan
amirrajan / readme.md
Last active November 10, 2024 14:28
xplat UI considerations for games

Things to consider when building a cross-platform game:

  1. Minimum button sizes for touch displays and small screen (eg steamdeck, mobile, nintendo switch hand held mode) is about 60 pixels. Anything smaller will fail lotcheck (Apple, Android, Nintendo).
  2. Visual feedback of UI interactions (Android, Apple -> they'll reject a feature/showcase of your game if you don't have this).
  3. Safe area/layout considerations. Avoid things like notches and app switch "chin". If you're making a game that can render edge to edge/without letter boxing, test at an aspect ratio of 21:12 (1680x960). Your safe are should be centered with an aspect ratio of 16:9 (placement of UI controls should always be in the safe area or they may be inaccesible because of notches and beveled edges).
  4. Button input detection with keyboard, touch, and gamepad. Navigation using keyboard, gamepad, mouse.
  5. Anything below 22px font size is pretty much unreadable on small screens (mobile, Steam Deck, Switch Lite).
  6. Text fields is a world of p
@joemasilotti
joemasilotti / .rouge-line-focusing.md
Last active April 17, 2025 15:19
Rouge syntax highlighting with line focusing

This gist shows how I'm using Rouge to highlight individual lines of code. On top of the existing syntax highlighting.

I'm using Sitepress which uses markdown-rails under the hood. But this should be applicable to any application rendering markdown with Redcarpet - sub out ApplicationMarkdown as your renderer.

Append @[] when setting the language in a fenced code block to highlight lines of code. Dashes will cover the range, inclusive. Commas will highlight each line.

Examples:

```swift@[4-6]
@leastbad
leastbad / README.md
Last active November 11, 2022 17:27
stimulus-youtube preview

My goal with this was to wrap the terrible YouTube Embed API in a Stimulus controller that would allow me to access the underlying API while providing some convenience methods. One key outcome is that the controller emits youtube events which contain the current position in the video. This means that other code can now respond to the position you are at in the video.

<div data-controller="youtube" data-youtube-code-value="Lo_1pyQ7xvc">
  <button data-action="youtube#play">Play</button>
  <button data-action="youtube#pause">Pause</button>
  <button data-action="youtube#stop">Stop</button>
  <br>
  <div data-youtube-target="frame"></div>
@KonnorRogers
KonnorRogers / geocode_job.rb
Last active April 16, 2022 10:51
async geocoding with Ruby-Geocoder
# app/jobs/geocode_job.rb
class GeocodeJob < ApplicationJob
def perform(model)
model.geocode
end
end
# app/filters/base_filter.rb
class BaseFilter
include ActiveModel::Model
include ActiveModel::Attributes
def initialize(session)
@_session = session
super(@_session.fetch(:filters, {})[filter_resource_class])
end
@chrisjakuta
chrisjakuta / BlogPage.jsx
Last active April 10, 2020 01:03
Blog Detail Page
import React, { useEffect, useState } from 'react'
import { Wave } from 'better-react-spinkit'
// now-ui views
import ProfilePageHeader from '../components/Headers/ProfilePageHeader'
import IndexNavbar from '../components/Navbars/IndexNavbar'
import DarkFooter from '../components/Footers/DarkFooter'
// Reactstrap components
@tpope
tpope / .gitattributes
Created October 24, 2010 20:38
Fewer conflicts in your Rails apps
Gemfile.lock merge=bundlelock
db/schema.rb merge=railsschema