Skip to content

Instantly share code, notes, and snippets.


Barbara Borges Ribeiro bborgesr

View GitHub Profile
bborgesr /
Created May 14, 2022 — forked from tykurtz/
Grokking the coding interview equivalent leetcode problems


I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

bborgesr / simple-server.js
Created Feb 4, 2020
A simple server to serve mock data for the Room Manager app (
View simple-server.js
const express = require("express");
const cors = require("cors");
const reservations = [
reservaID: 1,
usuarioID: 1,
salaID: 1,
data: "2020-01-31",
horaEntrada: "2020-01-31T10:00:00",
bborgesr / to-do-list-vanilla-js.html
Created Dec 19, 2019
A very simple ToDo app using only vanilla JS
View to-do-list-vanilla-js.html
<title>Wonderful Task Manager</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
bborgesr / cards-crud-inside-map-inside-buildCards.js
Last active Mar 14, 2019
[Make a CMS card's id unique] Reusing existing code, and keeping in mind that it's preferrable to destructure the object rather than mutate the id in place. #cms
View cards-crud-inside-map-inside-buildCards.js
try {
const card = buildCard(
Object.assign({}, settingsAndOptions, { cardIndex })
return {...card, id: `${}:${cardIndex}`};
bborgesr / exceptionally-good-presentations.txt
Created Feb 8, 2018 — forked from jmcphers/exceptionally-good-presentations.txt
How to Give an Exceptionally Good Presentation
View exceptionally-good-presentations.txt
Joe Cheng.............Moderator
Jennifer Bryan........As Herself
Hadley Wickham........As Himself
Aron Atkins...........Audience
Derrick Kearney.......Audience
bborgesr / shiny-insertUI-removable.R
Last active Apr 11, 2019
Uses Shiny's insertUI to create elements (in this example, datatables) at the user's discretion; each of these comes with a button that will remove it from the app (using removeUI).
View shiny-insertUI-removable.R
ui <- fluidPage(
textInput("divID", "Enter an ID for the custom area:", ""),
helpText("Leave the text input blank for automatically unique IDs."),
actionButton("isrt", "Add a datatable"),
tags$div(id = "placeholder")
server <- function(input, output, session) {
rv <- reactiveValues()
bborgesr / shiny-reactive-R6-object.R
Created Aug 1, 2017
Uses the reactiveTrigger() construct in an R6 object class in order to make it useful in reactive settings, like a Shiny app (MWE included)
View shiny-reactive-R6-object.R
reactiveTrigger <- function() {
counter <- reactiveVal( 0)
depend = function() {
trigger = function() {
bborgesr / pseudo-navigation-shiny.R
Created Jun 30, 2017
Implements pseudo navigation in a Shiny app
View pseudo-navigation-shiny.R
ui <- fluidPage(
tags$a("Go to Panel 1", href = "#panel1"), br(),
tags$a("Go to Panel 2", href = "#panel2"), br(),
tags$a("Go to Panel 3", href = "#panel3")
bborgesr / dynamic-dropdownMenu.R
Created May 9, 2017
How to dynamically add items to a dropdownMenu in shinydashboard
View dynamic-dropdownMenu.R
ui <- dashboardPage(
dashboardHeader(title = "Dropdowns 2.0",
helpText("Add another item to the dropdown menu by clicking ",
"on the button below"),
bborgesr / shiny-simple-iterative-printing.R
Created May 5, 2017
Two simple examples of iterative printing in Shiny
View shiny-simple-iterative-printing.R
# By default Shiny will always wait for any reactive dependencies to finish (re)calculcating
# before displaying the output that depends on them. Without async reactivity in Shiny (which
# is not currently available, but it's in the works), it's actually not really possible to
# make a reactive dependency be available before it finishes computing. But you can redefine
# your reactive so that its output is broken though.
# You can achieve this using reactive values, an observer and invalidateLater(). If this is
# new for you, I'd recommend, you read the documentation about invalidateLater().
# I'll show two simple examples here. For a more elaborate example, see this gist.