Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Reggi reggi

View GitHub Profile
@reggi
reggi / google-voice-recorder-bookmarklet.js
Last active Apr 14, 2021
This records keypresses in google voice and will add in 2 second pauses via ",".
View google-voice-recorder-bookmarklet.js
javascript:console.clear()%0Aconsole.log('Starting Google Voice capture bookmarklet')%3B%0A%0Alet buttons %3D %7B%0A '1'%3A document.querySelector(%60%5Baria-label%3D"1"%5D%60)%2C%0A '2'%3A document.querySelector(%60%5Baria-label%3D"'2' 'a' 'b' 'c'"%5D%60)%2C%0A '3'%3A document.querySelector(%60%5Baria-label%3D"'3' 'd' 'e' 'f'"%5D%60)%2C%0A '4'%3A document.querySelector(%60%5Baria-label%3D"'4' 'g' 'h' 'i'"%5D%60)%2C%0A '5'%3A document.querySelector(%60%5Baria-label%3D"'5' 'j' 'k' 'l'"%5D%60)%2C%0A '6'%3A document.querySelector(%60%5Baria-label%3D"'6' 'm' 'n' 'o'"%5D%60)%2C%0A '7'%3A document.querySelector(%60%5Baria-label%3D"'7' 'p' 'q' 'r' 's'"%5D%60)%2C%0A '8'%3A document.querySelector(%60%5Baria-label%3D"'8' 't' 'u' 'v'"%5D%60)%2C%0A '9'%3A document.querySelector(%60%5Baria-label%3D"'9' 'w' 'x' 'y' 'z'"%5D%60)%2C%0A '0'%3A document.querySelector(%60%5Baria-label%3D"'0'"%5D%60)%0A%7D%0A%0Alet recording %3D ""%0Aconsole.log(%60Recording is "%24%7Brecording%7D"%60)%0A%0Afunction
View gist:962c90f7c1b282efae750809ceeda515
  • 1 - Grand Illusion (Renoir,Jean) 1937
  • 2 - Seven Samurai (Kurosawa,Akira) 1954
  • 3 - The Lady Vanishes (Hitchcock,Alfred) 1938
  • 4 - Amarcord (Fellini,Federico) 1974
  • 5 - The 400 Blows (Truffaut,François) 1959
  • 6 - Beauty and the Beast (Cocteau,Jean) 1946
  • 7 - A Night to Remember (Baker,Roy Ward) 1958
  • 8 - The Killer (Woo,John) 1989
  • 9 - Hard Boiled (Woo,John) 1992
  • 10 - Walkabout (Roeg,Nicolas) 1971
@reggi
reggi / code.gs
Created Dec 16, 2020
Google Sheets Border Script
View code.gs
function colorAll() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 1;
var endRow = sheet.getLastRow();
for (var r = startRow; r <= endRow; r++) {
colorRow(r);
}
}
View tumblr-theme.html
<!DOCTYPE html>
<html lang="en" id="{block:IndexPage}index{/block:IndexPage}{block:PermalinkPage}permalink{/block:PermalinkPage}" class="no-js {block:ifNotInfiniteScroll}no-{/block:ifNotInfiniteScroll}infscr {block:ifNotEnableAnimations}no-{/block:ifNotEnableAnimations}animations transitions {block:ifNotFadeInPosts}no-{/block:ifNotFadeInPosts}fadein {block:ifNotLoadPostsIndividually}no-{/block:ifNotLoadPostsIndividually}loadsolo not-mobile {block:ifTransparentPostBackground}transbg{/block:ifTransparentPostBackground} {block:ifBorderAroundIndexPosts}border-post{/block:ifBorderAroundIndexPosts} {block:ifBorderAroundPermalinkContent}border-content{/block:ifBorderAroundPermalinkContent} {block:ifBorderAroundPermalinkMeta}border-meta{/block:ifBorderAroundPermalinkMeta} {block:ifPhotosStretchToFillWidth}photostretch{/block:ifPhotosStretchToFillWidth} {block:ifPhotosClickThroughToPermalink}photoclickthrough{/block:ifPhotosClickThroughToPermalink} {block:ifNotShowLikeAndReblogButtons}no-{/block:ifNotShowLikeAndReblog
View github-link-bookmarklet.js
View ddl-lookup.md

DDL Lookup table:

commands nodeDriverHandle hasWriteConcern isExplicitlyWrite hasWriteAspect4.0 operationFile4.0 hasWriteAspect3.6 operationFile3.6
View ideas.js
class MongoOptions () {
static parse () {
// does all the parsing without async eg DNS checking operations
}
static performAsync () {
// follow up handler to check eg DNS (async) tasks
}
static parseAsync () {
View class-design-discussion.md

Class Design Discussion

This is a document containg many different examples of how to create the same base code. Each example is different, contains a different API, or different added functionality such as cashing.

View rep-set.sh
echo "\nchanging the directory to home dir --------------------------------------------------------------------------------------------------------\n"
cd ~/
echo "\nkilling all running mongo processes -------------------------------------------------------------------------------------------------------\n"
mongod --shutdown --config /shared/replica-sets/mongod-repl-1.conf
mongod --shutdown --config /shared/replica-sets/mongod-repl-2.conf
mongod --shutdown --config /shared/replica-sets/mongod-repl-3.conf
echo "\nremoving all data directories -------------------------------------------------------------------------------------------------------------\n"
rm -rf /var/mongodb/db/1
@reggi
reggi / question-nestjs-graphql-nested-resolvers.md
Last active Jul 1, 2020
How do I have nested resolvers in nestjs / type-graphql?
View question-nestjs-graphql-nested-resolvers.md

I am trying to find a way that a resolver can essentially return another resolver using [nest.js][1] for creating [Resolvers][2], and [type-graphql][3] to create [object types][4].

Here's an example with the star-wars graphql api

{
  allVehicles(first: 1, last: 100) {
    vehicles {
      name