Skip to content

Instantly share code, notes, and snippets.

View corpulentcoffee's full-sized avatar

Dave Shifflett corpulentcoffee

View GitHub Profile
@corpulentcoffee
corpulentcoffee / notify-send
Last active November 26, 2020 18:49
Hack for notify-send to tolerate --expire-time false
#!/usr/bin/env python3
"""
Jest calls `node-notifier` using `notify({ timeout: false })`, which
ends up being sent down to `notify-send` with `--expire-time false`.
`notify-send` doesn't actually support this, which will write an error
of "Cannot parse integer value 'false' for --expire-time" to stderr and
exit with a non-zero status code.
@corpulentcoffee
corpulentcoffee / .inputrc
Created February 21, 2020 02:02
Enable bracketed paste mode for readline-based terminal applications
set enable-bracketed-paste on
@corpulentcoffee
corpulentcoffee / terminal.txt
Created July 10, 2019 00:49
Avail custom texinfo pages on Ubuntu
$ info thingie
info: No menu item 'thingie' in node '(dir)Top'
$ mkdir ~/info
$ for f in ~/Repos/thingie/doc/thingie.info*; do ln -s $f ~/info; done
$ ll ~/info
total 8
drwxr-xr-x 2 user123 user123 4096 Jul 9 19:44 ./
@corpulentcoffee
corpulentcoffee / terminal.txt
Created July 9, 2019 23:56
Avail custom man pages on Ubuntu
$ manpath
/usr/local/man:/usr/local/share/man:/usr/share/man
$ mkdir ~/man
$ manpath
/home/user123/man:/usr/local/man:/usr/local/share/man:/usr/share/man
$ man thingie
No manual entry for thingie
@corpulentcoffee
corpulentcoffee / .gtkrc-2.0
Created February 2, 2019 23:03
Enable arrow key expansion/collapse for tree views in GTK+ 2 applications
binding 'gtk-binding-tree-view' {
bind 'Left' { 'expand-collapse-cursor-row' (0,0,0) } # fold
bind 'Right' { 'expand-collapse-cursor-row' (0,1,0) } # expand
}
class 'GtkTreeView' binding 'gtk-binding-tree-view'
@corpulentcoffee
corpulentcoffee / cloudformation.yaml
Created November 2, 2018 16:29
Example CloudFormation template to setup a scheduled Lambda function using the Serverless transform
Transform: AWS::Serverless-2016-10-31
Parameters:
Env:
Type: String
Default: test
DomainName:
Type: String
Default: www.example.com
@corpulentcoffee
corpulentcoffee / stack.yaml
Created September 23, 2018 22:20
Example use of the Serverless transform's AutoPublishAlias feature in a CloudFormation stack of a CloudFront distribution with a custom Lambda handler
Transform: AWS::Serverless-2016-10-31
Resources:
CDN:
Type: AWS::CloudFront::Distribution
Properties:
DistributionConfig:
# . . .
DefaultCacheBehavior:
# . . .
@corpulentcoffee
corpulentcoffee / cloudfront.yaml
Created September 23, 2018 22:14
Example CloudFormation nested stack for connecting a CloudFront/ACM-powered website in a Route 53 zone
Parameters:
Zone: {Type: String}
Hostname: {Type: String}
Distribution: {Type: String, Default: ''}
ChallengeA: {Type: String, Default: ''}
ChallengeB: {Type: String, Default: ''}
CloudFrontDomain: {Type: String, Default: cloudfront.net.}
CloudFrontHostedZone: {Type: String, Default: Z2FDTNDATAQYW2}
ACMChallengeDomain: {Type: String, Default: acm-validations.aws.}
@corpulentcoffee
corpulentcoffee / gsuite.yaml
Created September 23, 2018 22:10
Example CloudFormation nested stack for enabling G Suite e-mail in a Route 53 zone
Parameters:
Zone: {Type: String}
Domain: {Type: String}
DKIMPubKey: {Type: String}
Resources:
MX:
Type: AWS::Route53::RecordSet
Properties:
HostedZoneId: !Ref Zone
@corpulentcoffee
corpulentcoffee / firebase.json
Created September 13, 2018 02:25
Example for wiring up a Firebase function and returning an STS header for HSTS preloading
{
"hosting": {
"rewrites": [
{"source": "**", "function": "handler"}
]
}
}