Skip to content

Instantly share code, notes, and snippets.

View saylestyler's full-sized avatar
🥰
= )

Tyler Sayles saylestyler

🥰
= )
View GitHub Profile
@saylestyler
saylestyler / petras.js
Created February 14, 2024 03:41
petras page example of scrolling behavior for brenda
import React, { useState, useEffect } from "react";
const PetrasPage = (props) => {
const [lastScrollY, setLastScrollY] = useState(window.scrollY);
const [logoPosition, setLogoPosition] = useState("0px");
useEffect(() => {
const handleScroll = () => {
const currentScrollY = window.scrollY;
Verifying my Blockstack ID is secured with the address 1JdxnfFfxUVj31HF7q1YBoswp7ge1twCDT https://explorer.blockstack.org/address/1JdxnfFfxUVj31HF7q1YBoswp7ge1twCDT
@saylestyler
saylestyler / debug
Created June 27, 2019 23:55
stack trace for debugging windows build
• building block map blockMapFile=release/SeeQL Setup 0.0.1.exe.blockmap
Error: /Users/t/seeql/node_modules/app-builder-bin/mac/app-builder exited with code 1
at ChildProcess.<anonymous> (/Users/t/seeql/node_modules/builder-util/src/util.ts:244:14)
at Object.onceWrapper (events.js:288:20)
at ChildProcess.emit (events.js:200:13)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
From previous event:
at MsiTarget.light (/Users/t/seeql/node_modules/app-builder-lib/src/targets/MsiTarget.ts:105:142)
at /Users/t/seeql/node_modules/app-builder-lib/src/targets/MsiTarget.ts:89:16
@saylestyler
saylestyler / fake-db-gen.sh
Created May 31, 2019 19:12
generate a postgresql db with N rows of randomized, structured data
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py &&
python get-pip.py &&
pip install fake2db &&
cd $HOME &&
fake2db --rows 1500 --db postgresql --name test_db &&
psql test_db
@saylestyler
saylestyler / tvim.rc
Last active June 4, 2019 17:47
cvimrc
set autoupdategist
set noautofocus
set nocncpcompletion
set smoothscroll
set hud
set noregex
set autoupdategist
set noinsertmappings
set typelinkhints
set defaultnewtabpage
['log', 'warn'].forEach(function(method) {
var old = console[method];
console[method] = function() {
var stack = (new Error()).stack.split(/\n/);
// Chrome includes a single "Error" line, FF doesn't.
if (stack[0].indexOf('Error') === 0) {
stack = stack.slice(1);
}
var args = [].slice.apply(arguments).concat([stack[1].trim()]);
set autoupdategist
set noautofocus
set nocncpcompletion
set smoothscroll
set hud
set noregex
set noinsertmappings
set typelinkhints
set defaultnewtabpage
let scrollduration = 10
@saylestyler
saylestyler / cookie.table.js
Created February 15, 2019 09:27
shows cookies in console in a gorgina table from https://github.com/bgrins/devtools-snippets
@saylestyler
saylestyler / plugin-add-responsive-typeography.css
Last active May 17, 2019 19:12
add responsive type to (almost) any page
* {
box-sizing: border-box;
}
html {
/* font-family: 'Muli', sans-serif; */
font-family: 'Ubuntu', sans-serif;
background: #EAEAEA;
color: #333;
@saylestyler
saylestyler / s.sh
Last active February 4, 2019 18:25
shell tings
# get the 20 most used commands
# https://github.com/trimstray/the-book-of-secret-knowledge#tool-terminal
history | \
awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | \
grep -v "./" | \
column -c3 -s " " -t | \
sort -nr | nl | head -n 20
# kill process running on port <port>