Skip to content

Instantly share code, notes, and snippets.

Git Inspector

Andrew Luca iamandrewluca

Git Inspector
View GitHub Profile

Can you convert a Value Object (i.e. JSON) to YAML?

My Expectation

My expectation is that a mid-senior level developer should be able to accomplish this task in under 4 hours:

  • write a basic solution in 30-60 minutes
  • debug / test / fine-tune for another 60-90 minutes
  • document, package, and publish within the remaining time

I could see it reasonable even if a developer takes 2 days to solve this for the first time - possibly because they needed to take a break but didn't, such as feeling pressure and getting brain freeze, taking an initial wrong approach, over-thinking the problem, and then just keeping beating the dead horse, etc - especially if they've never had to work independently before.

mjackson /
Last active Jul 7, 2022
Notes on handling redirects in React Router v6, including a detailed explanation of how this improves on what we used to do in v4/5

Redirects in React Router v6

An important part of "routing" is handling redirects. Redirects usually happen when you want to preserve an old link and send all the traffic bound for that destination to some new URL so you don't end up with broken links.

The way we recommend handling redirects has changed in React Router v6. This document explains why.


In React Router v4/5 (they have the same API, you can read about why we had to bump the major version here) we had a <Redirect> component that you could use to tell the router when to automatically redirect to another URL. You might have used it like this:

DavidWells / persist-page-views.js
Created Oct 10, 2021
Example of persisting page views via analytics package
View persist-page-views.js
import Analytics from 'analytics'
import onRouteChange from '@analytics/router-utils'
const persistPageViewsPlugin = {
name: 'persist-page-data-plugin',
page: ({ payload }) => {
const { properties } = payload
const pageView = {
path: properties.path,
title: properties.title,
jonathantneal / command.js
Last active Mar 19, 2022
Executable JavaScript Modules
View command.js
":" //#;exec /usr/bin/env node --input-type=module - $@<$0
import process from 'process'
const { argv } = process
iamandrewluca / bookmarks-to-notion.js
Last active Aug 12, 2022
Export browser bookmarks, import them in Notion as a database
View bookmarks-to-notion.js
(function bookmarksExportToCsv() {
* 1. Export bookmarks from browser (supported any Chromium based browsers and Safari) (chrome://bookmarks)
* 2. Open exported html file again in the browser
* 3. Copy paste this entire file in console, and execute it (hit enter)
* 4. You will be prompted to save a CSV file. Save it.
* 5. Open Notion. Click Import -> CSV
* 6. Select saved CSV file. Wait for import
* 7. You have a new database with all your bookmarks

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

erikras /
Last active Oct 19, 2021
Redux Form Docs Deploy

Directory structure

piecioshka /
Last active Sep 19, 2020
Terminal shortcuts (espacially for macOS)

Terminal shortcuts

  • ctrl + t — move current char backward
  • ctrl + e — move to the end
  • ctrl + p — move to the end
  • ctrl + n — move to the end
  • ctrl + d — the same as [delete]
  • ctrl + h — the same as [backspace]
  • ctrl + b — the same as [left arrow]
  • ctrl + f — the as [right arrow]
calebporzio / pure_html_css_modal.css
Last active Feb 28, 2022
The CSS for the pure HTML/CSS modal I tweeted about.
View pure_html_css_modal.css
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
cmrigney / useRedux.ts
Created Apr 11, 2019
Example for useRedux
View useRedux.ts
// Adapted code from
import { useContext, useState, useEffect, useCallback } from 'react';
import { ReactReduxContext } from 'react-redux';
import { bindActionCreators, ActionCreator } from 'redux';
export function useRedux() {
const { store } = useContext(ReactReduxContext);
const { getState, dispatch, subscribe } = store;
const reduxState = getState();