Skip to content

Instantly share code, notes, and snippets.

View connoro7's full-sized avatar

Connor Dillon connoro7

View GitHub Profile
@connoro7
connoro7 / .vimrc
Created May 6, 2020 00:45
.vimrc Settings
set number
set ruler
filetype indent on
set ai
set mouse=a
set incsearch
set hlsearch
set paste
set confirm
set ignorecase
@connoro7
connoro7 / exportSSH.sh
Last active May 24, 2020 19:56
Bash script to export all SSH keys (public and private) to external folder for backup on a cold storage drive.
#!/bin/bash
# Edit EXPORT_FOLDER to change the export location
EXPORT_FOLDER=~/ssh_export
# Append (or remove) any additional key locations you may have to the KEYS array.
KEYS=(~/.gnupg ~/.pki/nssdb ~/.gnome2/keyrings ~/.ssh /usr/local/apache2/conf/ssl.crt/server.crt /usr/local/apache2/conf/ssl.key/server.key /etc/ssh /etc/ssl/private /etc/cups/ssl)
#
echo -e "SSH Keys being sent to: \033[44;97m$EXPORT_FOLDER\033[0m"
for FILE in "${KEYS[@]}"
do
# for use with OSX
@connoro7
connoro7 / exa Enhanced v1
Created June 4, 2020 21:00
Exa alias options + documentation
##
# Author: Connor Dillon
# Created: June 4 2020
# Some useful `exa` aliases meant to replace standard `ls` usage.
# The aliases use `l` instead of `exa` to make use of muscle memory from typing `ls` all the time :)
# Use `$ exahelp` to print documentation to console
#
# Download `exa` via:
# OSX: $ brew install exa
# Linux: $ sudo apt-get install exa

Keybase proof

I hereby claim:

  • I am connoro7 on github.
  • I am dillpickles (https://keybase.io/dillpickles) on keybase.
  • I have a public key ASBU-ywQR77Pny0QblUqQNXwqsHeiBH5WE7mWj2r3dH24Qo

To claim this, I am signing this object:

@connoro7
connoro7 / express-starter.js
Created July 16, 2020 18:50
Express Starter
const express = require('express');
const morgan = require('morgan');
const cors = require('cors');
const app = express();
app.use(morgan('dev'));
app.use(cors());
app.get('/', (req, res) => {
@connoro7
connoro7 / heroku-quick-ref.md
Created July 16, 2020 19:22
Heroku Quick Reference Sheet

Heroku Quick Reference

heroku login # login once
heroku create [name] # Initializes heroku app and adds remote.
heroku addons:create heroku-postgresql # add a postgres db addon to your heroku app
heroku logs [--tail] # Shows heroku server terminal
heroku pg:psql # connect to heroku addon database server
heroku config # shows heroku environment variables
 - heroku config:set clown=fiesta # set a config variable
@connoro7
connoro7 / async-await-info.md
Created July 16, 2020 19:23
Async & Await Reference Sheet

async & await

Callbacks

request('http://www.omdbapi.com/?s=star%20wars', (error, response, body) => {
  const results = JSON.parse(body);
  console.log(results);
});
@connoro7
connoro7 / arrows-vs-IIFEs.md
Created July 16, 2020 19:24
Arrow Function vs. Functional IIFEs

Arrows Functions vs. Function IIFEs

When creating an IIFE, use a regular function, NOT an arrow function.

With a fat arrow, this is bound to the this of the surrounding code (in this case Window or Global).

(() => {
 'use strict';
@connoro7
connoro7 / trees.md
Created July 16, 2020 19:25
Trees Reference Sheet

Tree

A collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated (a child can only have 1 parent), and none points to the root.


Recursive Definition