Skip to content

Instantly share code, notes, and snippets.

View aaronromeo's full-sized avatar
:shipit:

Aaron Romeo aaronromeo

:shipit:
View GitHub Profile
@aaronromeo
aaronromeo / rails-init.md
Last active January 7, 2019 16:42
My Rails init setup

The Non API version...

Generate a new app

  • Setup the app using postgres
  • Skip bundle install
  • Skip test files
rails _4.2.7.1_ new myapp -T -d postgresql --skip-turbolinks -B

Create a new PG DB role

Understanding the problem and assumptions

  • CAP Theorem problem
    • Partition tolerance will fail as a result of network connections
    • This solution maximises for availability of data
    • The assumption here is that the consistency of data is less important
  • Users need to be logged in to make changes
  • Sync server is responsible for reducing events
  • Two solutions proposed
    • If no newsfeed or watching other users is required, a movie's favourites are only retrieved when a movie is read
  • If watching other users is required, the solution is more fragile, and should probably result in a push from the server to the device to ensure a proper success response code (which isn't possible in the case of the server getting the results)
@aaronromeo
aaronromeo / audio_fragment.json
Created December 6, 2016 02:28
Messenger Bot message fragments
{
"attachment":{
"type":"audio",
"payload":{
"url":"https://petersapparel.com/bin/clip.mp3"
}
}
}
@aaronromeo
aaronromeo / cypress.Dockerfile
Created May 28, 2019 16:47
Getting Cypress to wait for the server to start
FROM cypress/included:3.3.0
RUN apt-get update && apt-get install -y wget
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
RUN npm install [email protected]
@aaronromeo
aaronromeo / medusa.sh
Last active March 5, 2022 00:44
Digital Ocean Scripts
#!/bin/sh
# Use this as the command for the user script
# curl https://gist.githubusercontent.com/aaronromeo/a683c9810aad108fab2ae6b3bc583372/raw/medusa.sh | sh
# add docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"