Skip to content

Instantly share code, notes, and snippets.

@bbuechler
bbuechler / build-a-bastion.sh
Last active December 22, 2022 19:18
Deploy a SSM-Bastion with magic key pulling
# Upload your key to NGAP Bastion Self-serve bucket
# https://wiki.earthdata.nasa.gov/display/ESKB/SSH+Bastion+Key+Upload+-+Self-Service
export key_bucket=$(aws s3 ls | xargs -n1 echo | grep ngap-bastion-authorized-public-keys)
export my_ssh_key="/path/to/.ssh/<your_private_key>"
aws s3 cp $my_ssh_key.pub s3://$key_bucket/
# Optional Params with Reasonable Defaults that you may want to change
export bastion_name="SSM Bastion"
export instance_type="t2.micro"
@joseluisq
joseluisq / stash_dropped.md
Last active June 21, 2024 07:36
How to recover a dropped stash in Git?

How to recover a dropped stash in Git?

1. Find the stash commits

git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )

This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.

@vxhviet
vxhviet / simplifiedGitFlow.md
Last active August 11, 2023 18:31
A simplified version of Git Flow

Simplified Git-flow

                        RELEASE TAG
o----------------------------o-----------------o------------o------> MASTER
 \                          /  \                \----------/ HOTFIX
  \                        /    \                          \
   \----------------------/      \--------------------o-----o------> DEVELOP
                                  \                  /
 \----------------/ FEATURE
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active May 22, 2024 13:44
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active June 29, 2024 09:50
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@fatso83
fatso83 / collaborator.js
Last active January 26, 2023 10:54
Demonstrates how to stub and test for collaborators in a class constructor using sinon and proxyquire. See https://github.com/sinonjs/sinon/issues/831
module.exports = function(n){
// do something with n
}
@flamingbear
flamingbear / compute N3B polarstereo areas by python.ipynb
Last active January 13, 2016 20:21
Compute N3B areas with shapely
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maxberggren
maxberggren / basemap_tutorial.ipynb
Last active March 19, 2016 21:49
Basemap tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chantastic
chantastic / on-jsx.markdown
Last active May 30, 2024 13:11
JSX, a year in

Hi Nicholas,

I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:

The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't