Skip to content

Instantly share code, notes, and snippets.

View lee-dohm's full-sized avatar
😴
Taking some well-deserved naps

Lee Dohm lee-dohm

😴
Taking some well-deserved naps
View GitHub Profile
@lee-dohm
lee-dohm / esm-package.md
Created July 12, 2021 20:59 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@lee-dohm
lee-dohm / github-actions.md
Last active December 8, 2020 11:02
GitHub Actions presentation notes

GitHub Actions

Outline

  • What is GitHub Actions useful for?
    • How is it different from Probot?
  • Workflows -- Sample Workflow
    • on
    • resolves
  • Works similar to Make targets but not ordered
@lee-dohm
lee-dohm / query.graphql
Created June 11, 2019 20:28
GraphQL: Get list of issues assigned to a user given an organization name
{
search(query: "org:org-name is:issue assignee:user-name", type: ISSUE, first: 100) {
nodes {
... on Issue {
url
}
}
}
}
@lee-dohm
lee-dohm / package-spaces.json
Created August 1, 2018 18:48
Tab types testing
{
"name": "atom",
"productName": "Atom",
"version": "1.31.0-dev",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/main-process/main.js",
"repository": {
"type": "git",
"url": "https://github.com/atom/atom.git"
},
@lee-dohm
lee-dohm / blast-templates
Created April 2, 2018 20:17
Sample script to copy templates from a given location into a repo
#!/usr/bin/env ruby
require 'fileutils'
# Use: atom-templates [repo_name]
#
# 1. Clone the repository if it doesn't already exist; fetch `master` if it does
# 2. Clean up old `template-update` branch if it exists
# 3. Check out new branch `template-update` based on `origin/master`
# 4. Copy template files over
@lee-dohm
lee-dohm / article-test.exs
Last active May 28, 2018 09:59
Sample files for blog post "Simpler Elixir Travis Configuration" ... http://www.lee-dohm.com/2017/12/24/simpler-elixir-travis-configuration/
use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :hello_phoenix, HelloPhoenix.Endpoint,
http: [port: 4001],
server: false
# Print only warnings and errors during test
config :logger, level: :warn
@lee-dohm
lee-dohm / terms-for-haunted-houses.md
Created October 27, 2017 16:44
Terms for entering a haunted house

My terms for entering a haunted house:

  1. I will not enter a room first
  2. I will not exit a room last
  3. I will not go to investigate any suspicious noises nor go searching for a fuse box
  4. Under no circumstances will I be left alone without a weapon of some sort

-- http://www.imdb.com/title/tt0890819/quotes/qt0431710

@lee-dohm
lee-dohm / sliding_session_timeout.ex
Created June 4, 2017 23:01 — forked from qertoip/sliding_session_timeout.ex
Elixir / Phoenix Sliding Session Timeout Plug
# How to use it:
#
# Plug it at the end of your :browser pipeline in your Phoenix app router.ex
# Make sure it is plugged before your session-based authentication and authorization Plugs.
#
# pipeline :browser do
# plug :accepts, ["html"]
# plug :fetch_session
# plug :fetch_flash
# plug :put_secure_browser_headers