Skip to content

Instantly share code, notes, and snippets.

View robconery's full-sized avatar
🤩

Rob Conery robconery

🤩
View GitHub Profile
@robconery
robconery / azure_wordpress.sh
Last active August 24, 2020 19:14
Spin up Wordpress on Azure Using Managed Services
RG="[YOUR RESOURCE GROUP]"
APPNAME=$RG-wordpress #Name what you want
LOCATION="Central US" #put where you like
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
#accepted values for the service plan: B1, B2, B3, D1, F1, FREE, P1, P1V2, P2, P2V2, P3, P3V2, PC2, PC3, PC4, S1, S2, S3, SHARED
@robconery
robconery / azure_ghost.sh
Last active January 28, 2020 10:10
Deploy Ghost to Azure Services
RG="azx"
APPNAME=$RG-ghost
LOCATION="Central US"
#Recommend to keep these random, but if you need to change go for it
USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
SERVERNAME=server$RANDOM #this has to be unique across azure
tag:
git tag -l "deploy-$(date +%Y-%m-%d-%T)"
commit:
git commit -am "Deploying $(date +%Y-%m-%d-%T)"
build:
bundle exec middleman build
deploy: build commit tag
@robconery
robconery / ghost_azure.sh
Created April 10, 2019 01:42
Create a complete Ghost Website on Azure with Domain Assignment
RG="BLOG"
APPNAME="conery-ghost"
IMAGE=ghost
DOMAIN="ghost.conery.io"
DB_USER=admin_$RANDOM #set this to whatever you like but it's not something that should be easy
DB_PASS=$(uuidgen) #Again - whatever you like but keep it safe! Better to make it random
DB_SERVERNAME=server$RANDOM
#You can get a list of locations by running
#az account list-locations --query [].name
@robconery
robconery / jsonb.js
Last active April 21, 2021 08:10
A Simple JSONB Module for Node
const runner = require("./runner");
const transformRecord = function(record) {
if (record) {
const doc = record.doc;
doc.createdAt = record.created_at;
doc.id = record.id;
return doc;
} else {
return null;
const functions = require('firebase-functions');
const stripe = require("./lib/stripe");
exports.createCheckoutSession = functions.https.onCall(async (data, context) => {
console.log("Checkout session request incoming", data);
const res = await stripe.createSubscriptionCheckout(data);
return res;
});
@robconery
robconery / Dockerfile
Last active September 11, 2022 06:43
Local Postgres with PGWeb
FROM postgres:14-alpine
COPY ff.sql /docker-entrypoint-initdb.d/seed.sql
ENV POSTGRES_USER=docker POSTGRES_PASSWORD=docker POSTGRES_DB=ff
EXPOSE 5432
@robconery
robconery / chinook.sql
Created March 8, 2023 17:31
The Chinook/PG Database
This file has been truncated, but you can view the full file.
/*******************************************************************************
Chinook Database - Version 1.4
Script: Chinook_PostgreSql.sql
Description: Creates and populates the Chinook database.
DB Server: PostgreSql
Author: Luis Rocha
License: http://www.codeplex.com/ChinookDatabase/license
Modified By: John Atten
@robconery
robconery / mission-interview-mindset.md
Created September 27, 2023 19:07
Mission Interview Mindset

I know you're wanting to jump right in and practice, but do yourself a favor and take a minute to get your head in the right place. So many people get super frustrated with this process and decide it's all a bunch of crap - and then they give up and either fail the interview or cancel before they get there.

Seriously - I can't tell you how many times I've heard a friend tell me how stupid Company X is becaust they wanted them to write a basic algorithm on the white board. The sentiment is always the same:

What does writing a search algorithm have to do with my job? NOTHING. Why are they even asking me this crap!

They're asking you these questions because, believe it or not, people like to lie on their resume. They don't know you and they especially don't know what you know. They want to be sure you can do the things you say you can do on your resume, so they're going to ask you to solve some problems.

So, deep breath. Let's do this - these are very good jobs and these companies want to pay you a

@robconery
robconery / mission-interview-stocks.md
Created September 27, 2023 19:15
Mission Stock Price

OK grab your journal and dive in with me! I'll be solving this question by hand I urge you to do the same. I'll show you the solution near the end - but give it your best shot!

This question is from InterviewCake - thanks to Parker Phinney for permission to use. You can solve it there right now, if you like, as it’s part of the free questions.

Here’s the question:

Write an efficient function that takes stockPricesYesterday and returns the best profit I could have made from 1 purchase and 1 sale of 1 Apple stock yesterday.

Starter code: