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 / templates
Created March 22, 2017 16:18
Script to create a templates PR for 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 / gist:3439284
Created August 23, 2012 17:40
Detect the debugger using Objective-C on iOS or OS X
#include <assert.h>
#include <stdbool.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/sysctl.h>
static bool AmIBeingDebugged(void)
// Returns true if the current process is being debugged (either
// running under the debugger or has a debugger attached post facto).
{
@lee-dohm
lee-dohm / checklist.md
Last active July 8, 2019 04:17
Travel checklist

Checklist

Pre-packing activities

  • Put Swiss Army knife in safe place
  • Put keys in safe place
  • Set aside valet key for Raven
  • Charge laptop
  • Do laundry
@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 / 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