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
❌ 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
** ** ****
/** /** /**/
****** /** ***** /** ***** ******
//////** /****** **///** ****** **///**///**/
******* /**///**/** // **///**/******* /**
**////** /** /**/** **/** /**/**//// /**
@usergenic
usergenic / Dockerfile
Created March 6, 2019 00:30
With just these three files, you can run a sinatra app with redis using Docker.
FROM ruby:2.5.1-alpine
WORKDIR /code
RUN gem install sinatra
RUN gem install redis
CMD ["ruby", "app.rb"]
@usergenic
usergenic / Keybase.proof
Created January 30, 2019 23:03
Keybase Proof for Usergenic
### Keybase proof
I hereby claim:
* I am usergenic on github.
* I am usergenic (https://keybase.io/usergenic) on keybase.
* I have a public key ASDCvMzeMiJyo3HPfrEzib_0xvb6Pw3VmIW8IUyx6xKLWQo
To claim this, I am signing this object: