Skip to content

Instantly share code, notes, and snippets.

View jul-sh's full-sized avatar

jul-sh jul-sh

  • Google DeepMind
  • New York City
  • 02:50 (UTC -05:00)
View GitHub Profile
describe('The `mergeTwoSortedArrays` function', () => {
it('merges two sorted arrays', async () => {
expect(mergeTwoSortedArrays([1, 3, 5, 7], [2, 4, 6, 8, 10])).toEqual([
1,
2,
3,
4,
5,
6,
7,

Keybase proof

I hereby claim:

  • I am juliettepretot on github.
  • I am julsh (https://keybase.io/julsh) on keybase.
  • I have a public key ASCrf6x-EPPgpQBkXusyDW9hdVYuw3PbjbR8ZJqsTylVAQo

To claim this, I am signing this object:

@jul-sh
jul-sh / useObjectToKey.js
Last active February 11, 2020 11:14
The goal of this hook is to provide an alternative to using indexes as keys in react. Instead, what if we could use the object references as keys. Since React only accepts strings as keys, let's associate string keys to object references.
import React from 'react'
import { render } from 'react-dom'
/*
The goal of this hook is to provide an alternative to using indexes as
keys in react. Instead, what if we could use the object references as keys.
Since React only accepts strings as keys, let's associate string keys to
object references.
@jul-sh
jul-sh / about.md
Last active February 9, 2019 19:04
connectHooks

I'm not sure a HoC for hooks is a good idea, but it seemed fun to build. Also, it may come in handy when adding new code to old components.

Use like so:

export default connectHooks([
  {
    hook: useFetch,
 hookArgs: ["https://swapi.co/api/people/1"],
function fish_prompt
set -l last_status $status
set -l cyan (set_color -o cyan)
set -l yellow (set_color -o yellow)
set -l red (set_color -o AE111D)
set -l blue (set_color -o blue)
set -l green (set_color -o green)
if not set -q __fish_git_prompt_show_informative_status
set -g __fish_git_prompt_show_informative_status 1
import { useState, useEffect } from 'react'
// Use this hook to quickly read whether a component is being rendered server
// side or client-side. This can be helpful when building components that are
// intended to work without client-side JavaScript.
// Use like:
// const isMounted = useIsMounted()
const useIsMounted = () => {
[core]
excludesfile = /Users/juliettepretot/.gitignore_global
editor = code -n -w
ignorecase = false
[commit]
template = /Users/juliettepretot/.stCommitMsg
[push]
default = current
[diff]
tool = default-difftool
@jul-sh
jul-sh / extensions.json
Last active February 19, 2020 09:36
nonoroazoro.syncing
[
{
"id": "bierner.lit-html",
"name": "lit-html",
"publisher": "bierner",
"version": "1.11.1"
},
{
"id": "bradgashler.htmltagwrap",
"name": "htmltagwrap",