Skip to content

Instantly share code, notes, and snippets.

View joelhooks's full-sized avatar
🍄

Joel Hooks joelhooks

🍄
View GitHub Profile
@joelhooks
joelhooks / egghead_CLA
Last active November 14, 2020 18:55 — forked from CLAassistant/SAP_CLA
egghead.io Individual Contributor License Agreement
### egghead.io Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by egghead.io, LLC or its affiliates (“egghead.io”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to egghead.io in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact support@egghead.io.
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License.** You hereby grant, and agree to grant, to egghead.io a non-exclu
@joelhooks
joelhooks / progress.sql
Created October 10, 2020 19:18
access the individual user's progress through a list of lists via polymorphic join table
select lesson from (
with
-- root collection is a collection of collections (playlist of playlists) which use a polymorphic join table (tracklists) so we want to snag the ids of the sub-collection.
root_collection_ids as ( select tracklists.tracklistable_id id from playlists inner join tracklists on playlists.id = tracklists.playlist_id where playlists.slug = 'some-playlist-id' and tracklists.tracklistable_type = 'Playlist'),
-- the next layer are video resources (lessons) that are the tracklists of the tracklists
lesson_ids as (select tracklists.tracklistable_id lesson_id from root_collection_ids inner join tracklists on root_collection_ids.id = tracklists.playlist_id where tracklists.tracklistable_type = 'Lesson' )
-- we only care about completions so we can get the slug id for all of the video resources (lessons) the user has completed and sort display on the client accordingly
@joelhooks
joelhooks / machine.js
Last active September 8, 2020 19:45
Generated by XState Viz: https://xstate.js.org/viz
const playerMachine = Machine({
id: 'player',
initial: 'loading',
context: {
retries: 0
},
states: {
loading: {
on: {
@joelhooks
joelhooks / machine.js
Last active May 28, 2020 00:39
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@joelhooks
joelhooks / machine.js
Last active April 24, 2020 08:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@joelhooks
joelhooks / machine.js
Last active April 22, 2020 01:11
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@joelhooks
joelhooks / egghead-screencast-guideline.md
Last active December 12, 2019 04:03
It seems trivial to record a 1-8 minute screencast, but there are actually quite a few moving parts when it comes to recording a **high quality** screencast. Here's some of our thoughts on the subject.

Recording a Great Coding Screencast

The Screen

First and foremost a coding screencast is about the code, and we need to make sure it looks great. There are a few aspects to this that help ensure that is the case.

Resolution

720p is the target resolution. In pixel terms this is 1280x720. We've gotten the best results when we record at 2560x1440 in a HiDPI (pixel double) mode, giving an effective visible resolution of 1280x720, but extremely crisp. This resolution is achievable on 27" monitors and retina MBPs.

@joelhooks
joelhooks / drip_to_convertkit.js
Created January 10, 2019 23:58
This is a little node app that creates individual csv files for each tag in an exported Drip subscriber (people!) csv
const _ = require('lodash')
const fs = require('fs')
const csv = require('csv-parser')
const writer = require('fast-csv')
const csvFilePath = 'PATH_TO.csv'
const filesToBuild = {}
fs.createReadStream(csvFilePath)
### Keybase proof
I hereby claim:
* I am joelhooks on github.
* I am joelhooks (https://keybase.io/joelhooks) on keybase.
* I have a public key whose fingerprint is 251E 1196 F0E2 7B60 686B E7F2 BE4C F2AD E4D6 2AB7
To claim this, I am signing this object:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<style type="text/css">
/**
* RESETS
*/
/* Based on The MailChimp Reset INLINE: Yes. */