Skip to content

Instantly share code, notes, and snippets.

View usergenic's full-sized avatar
💭
Manifesting dreams! 🦄

Brendan Baldwin usergenic

💭
Manifesting dreams! 🦄
View GitHub Profile

omgbase Individual Contributor License Agreement (ICLA)

Thank you for contributing to omgbase. This agreement protects both you and the project: it lets the project use your contributions — including under future licenses — while you keep ownership of your work. The CLA Assistant bot will prompt you to accept this when you open your first pull request.

1. Definitions

  • "You" means the individual contributor accepting this agreement.
  • "Project" means omgbase, maintained by Brendan Baldwin ("Maintainer").
  • "Contribution" means any original work of authorship — code, documentation, or other material — that You submit to the Project for inclusion in its repositories. "Submit" means any electronic, verbal, or written communication sent to the Maintainer (pull requests, issues, email, chat), except communication You conspicuously mark in writing as not a contribution.
@usergenic
usergenic / prolog_in_ruby_dsl.rb
Created September 29, 2025 17:41
example dsl to support prolog in ruby using instance eval
extend Prolog
facts do
# possibly symbols/strings are interchangeable for atoms
# since symbols are convenient
editor(:alice, :vim)
editor(:bob, :emacs)
editor(:carol, :vim)
editor(:devon, :emacs)
❌ basic scrolling functionality, via scrollTo() > vertical > using <lit-virtualizer>... > ...and window scrolling > instant scrolling > should take no time and end up where it is supposed to
AssertionError: expected 42 to equal 1
+ expected - actual
-42
+1
at o.<anonymous> (src/test/scenarios/scrolling.test.ts:98:31)
❌ basic scrolling functionality, via scrollTo() > vertical > using <lit-virtualizer>... > ...and virtualizer scrolling > instant scrolling > should take no time and end up where it is supposed to
@usergenic
usergenic / gist:fa25a6c0abe44b1dc0e1ddc17f25c6b8
Created November 28, 2022 22:03
A record of virtualizer scrolling.test passed with visibility: 'hidden' removed from the sizer element
github.com/lit/lit~rethink-scroll-to/packages/labs/virtualizer (rethink-scroll-to-with-logging-for-te$ npm test
> @lit-labs/virtualizer@0.7.2 test
> wireit
✅ [../../internal-scripts:build:ts] Already fresh
✅ [../../internal-scripts:build] No command to execute
✅ [build:copy-polyfill] Already fresh
✅ [../../reactive-element:build:babel] Already fresh
✅ [../../reactive-element:build:ts] Already fresh
@usergenic
usergenic / intel laptop
Created November 19, 2022 05:32
scrolling.test console.logs figuring out why horizontal scroller's scrollWidth doesn't behave same in two environments
BEGIN TEST instant scrolling should take no time and end up where it is supposed to
1668835715937 _sizeHostElement( { width: 100000, height: null } )
1668835715937 inside _getSizer() and...
i cant find my sizer
I JUST SET THE SIZER STYLE TO translate(100000px, 0px)
1668835715937 _sizeHostElement( { width: 50000, height: null } )
1668835715937 inside _getSizer() and...
i have a sizer
translate(100000px, 0px)
@usergenic
usergenic / migrate.sh
Last active June 15, 2022 07:01
lit-virtualizer migration
#!/bin/sh
echo
echo "#####################################"
echo "Prepare a workspace for the migration"
echo "#####################################"
echo
# removes existing workspace, but don't wait
# for rm -rf because it takes too long.
@usergenic
usergenic / migrate.sh
Created May 26, 2022 22:45
lit-virtualizer migration to monorepo script
#!/bin/sh
echo
echo "#####################################"
echo "Prepare a workspace for the migration"
echo "#####################################"
echo
rm -rf lit-virtualizer-migration
mkdir -p lit-virtualizer-migration
@usergenic
usergenic / life.py
Created January 13, 2022 23:31
Quick Conway's Game of Life implementation
# You can run this on http://pythonsandbox.com/graphics
import sandbox
import time
canvas = sandbox.createCanvas()
def makegrid(width,height):
return [[0 for y in range(0, height)] for x in range(0, width)]
@usergenic
usergenic / getpkg.sh
Last active November 8, 2019 07:10
getpkg bash function for retrieving an unpkg module URL and its transitive import dependencies
# Proof of Concept
#
# download unpkg locally and all imported transitive dependencies
# only tested with ?module type URLs so far, e.g.
#
# getpkg "https://unpkg.com/lit-element@latest?module"
#
# obviously hella brittle because module specifier extraction is
# a dumb regexp.
#
@usergenic
usergenic / figlets.txt
Created May 16, 2019 03:38
figlet -l | while read FONT; do echo $FONT; figlet -f $FONT abcdef; done > figlets.txt
1Row
/\ ]3 ( |) [- /=
3-D
** ** ****
/** /** /**/
****** /** ***** /** ***** ******
//////** /****** **///** ****** **///**///**/
******* /**///**/** // **///**/******* /**
**////** /** /**/** **/** /**/**//// /**