Skip to content

Instantly share code, notes, and snippets.

View garrett-green's full-sized avatar
💚

Garrett Green garrett-green

💚
View GitHub Profile
@garrett-green
garrett-green / GIF-Screencast-OSX.md
Created March 20, 2024 18:46 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@garrett-green
garrett-green / keybase.md
Created April 17, 2019 14:40
keybase.md

Keybase proof

I hereby claim:

  • I am garrett-green on github.
  • I am garrettgreen (https://keybase.io/garrettgreen) on keybase.
  • I have a public key ASC6MuIKAZUZXEoRBjaXypPC7FhL7TXG8GG2_JLAf2nGqQo

To claim this, I am signing this object:

@garrett-green
garrett-green / export_google_music.js
Created March 28, 2019 20:15 — forked from jmiserez/export_google_music.js
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@garrett-green
garrett-green / anagram-detector.md
Last active November 16, 2021 22:48
Anagram Detector | REACTO

Prompt

You are given an array of strings only (could be words, phrases etc). Create a function to find all the anagrams within that array. The output should be an array where each element in the array is itself an array of anagrams.


Examples

const words = ['cat', 'act', 'ignore', 'a phrase', 'tape', 'pate', 'e hpsara'];
@garrett-green
garrett-green / prefix-search.md
Last active November 16, 2021 22:48
Prefix Search | REACTO

Prefix Search


Prompt

Given a "book" and a string to search for, return an array of the character indices for every word in the book that begins with that string.

The book will contain two things: a book id and a string of English text. The search should be case insensitive.

@garrett-green
garrett-green / string-search.md
Created February 26, 2019 22:07
String Search [ AKA indexOf() ] | REACTO

String Search (indexOf())


Prompt

  • Given a 2 strings as input, write the function indexOf(needle, haystack) that returns the index of the first appearance of the first string (the needle) inside the second (the haystack).

  • DO NOT USE built-in string methods like indexOf(), includes() or substring()

@garrett-green
garrett-green / balanced-brackets.md
Last active February 12, 2019 15:26
Balanced Brackets

Prompt

Write a function that determines whether an input string has balanced brackets.

You are given an input string consisting of brackets—square [ ], round ( ), and curly { }. The input string can include other text. Write a function that returns either true if the brackets in the input string are balanced or false if they are not. Balanced means that any opening bracket of a particular type must also have a closing bracket of the same type.

An empty input string or a string without brackets can also be considered "balanced".

Examples

@garrett-green
garrett-green / subset-sum.md
Last active April 24, 2022 01:07
Subset Sum

Prompt

Given a target sum and an array of positive integers, return true if any combination of numbers in the array can add to the target. Each number in the array may only be used once. Return false if the numbers cannot be used to add to the target sum.

Examples

subsetSum(2, [1, 10, 5, 3]); // false
subsetSum(10, [1, 10, 5, 3]); // true (10 === 10)
subsetSum(9, [1, 10, 5, 3]); // true (1+3+5 === 9)
@garrett-green
garrett-green / reactos.md
Created December 11, 2018 22:46 — forked from lotust/reactos.md
REACTO 1809-FSA-CH