Skip to content

Instantly share code, notes, and snippets.

@AndrewEastwood
AndrewEastwood / hello.md
Last active May 29, 2023 12:07
hello :)




@AndrewEastwood
AndrewEastwood / haproxy.conf
Created November 3, 2021 15:09 — forked from Wu-Wu/haproxy.conf
HAProxy configuration to deploy PSGI application
#
# application entry points
# https://www.example.com/ (production)
# https://demo.example.com/ (demo/lite production)
# https://devel.example.com/ (development)
#
# static content served by nginx server
# http://app-be1.example.net:4xxx/
# http://app-be2.example.net:4xxx/
#
@AndrewEastwood
AndrewEastwood / helpful-docker-commands.sh
Created November 3, 2021 11:10 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@AndrewEastwood
AndrewEastwood / mapper5.js
Last active July 9, 2021 13:07
set/update value in an object
const mapper5 = (keys, v, o) => {
if (keys.length === 0) {
return o;
}
if (keys.length === 1) {
return { ...o, [keys[0]]: v };
}
const key = keys[0];
const isNextKeyForArray = /[0-9]+/.test(keys[1] || '');
@AndrewEastwood
AndrewEastwood / download-file.js
Created September 9, 2020 17:14 — forked from javilobo8/download-file.js
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@AndrewEastwood
AndrewEastwood / gist:7d1b0f351210e7b0f0da515976af2b4e
Created April 12, 2016 12:43 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods