const assert = require('assert')
const BLUEBIRD = require('bluebird')
const nameAsync1 = async (name) => name
const nameAsync2 = (name) => Promise.resolve(name)
const nameAsync3 = (name) => BLUEBIRD.resolve(name)
const nameSync = (name) => name
const isPromise1 = (value) => Promise.resolve(value) === value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# variables.tf | |
variable "myapp_conf" { | |
type = map | |
} | |
# terraform.tfvars | |
myapp_conf = { | |
REPLICAS = 0 | |
LIMIT_CPU = "50m" | |
LIMIT_MEMORY = "96Mi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target | |
sudo vim /etc/systemd/logind.conf | |
# Replace whatever values of following to "ignore" | |
HandleHibernateKey=ignore | |
HandleLidSwitch=ignore | |
HandleLidSwitchExternalPower=ignore | |
HandleLidSwitchDocked=ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Listed generated on 2021-08-07 at 3:45am EST | |
curl -s -X GET -H "Content-Type: application/json" \ | |
-H "Authorization: Bearer ${DIGITALOCEAN_ACCESS_TOKEN}" \ | |
"https://api.digitalocean.com/v2/images?page=1&per_page=100&type=distribution" \ | |
| jq '.images[].slug' | sort | |
"centos-7-x64" | |
"centos-8-x64" | |
"centos-stream-8-x64" | |
"debian-10-x64" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
groups: | |
- docker | |
users: | |
- default | |
# the docker service account | |
- name: docker-service | |
groups: docker | |
package_upgrade: true | |
packages: |
I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.
There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*
, e.g.:
:vs **/*<partial file name><Tab>
- Download docker-compose.yml to dir named
sentry
- Change
SENTRY_SECRET_KEY
to random 32 char string - Run
docker-compose up -d
- Run
docker-compose exec sentry sentry upgrade
to setup database and create admin user - (Optional) Run
docker-compose exec sentry pip install sentry-slack
if you want slack plugin, it can be done later - Run
docker-compose restart sentry
- Sentry is now running on public port
9000
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config file | |
# vim ~/.config/fish/config.fish | |
# reload the config | |
# source ~/.config/fish/config.fish | |
# set the workspace path | |
set -x GOPATH /users/my-username/go | |
# add the go bin path to be able to execute our programs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this snippet to the top of your playbook. | |
# It will install python2 if missing (but checks first so no expensive repeated apt updates) | |
# gwillem@gmail.com | |
- hosts: all | |
gather_facts: False | |
tasks: | |
- name: install python 2 | |
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) |
NewerOlder