Skip to content

Instantly share code, notes, and snippets.

View excid3's full-sized avatar
:shipit:
Shipping

Chris Oliver excid3

:shipit:
Shipping
View GitHub Profile
# Logfile created on 2019-02-06 14:39:16 -0800 by logger.rb/66358
INFO ---------------------------------------------------------------------------
INFO START 2019-02-06 14:39:16 -0800 cap production deploy
INFO ---------------------------------------------------------------------------
DEBUG [a31dcb3c] Running [ -d $HOME/.rbenv/versions/2.5.3 ] as deploy@104.248.186.100
DEBUG [a31dcb3c] Command: [ -d $HOME/.rbenv/versions/2.5.3 ]
DEBUG [7cf4009d] Finished in 9.738 seconds with exit status 0 (successful).
INFO [1bc30033] Running /usr/bin/env mkdir -p /tmp as deploy@104.248.186.100
DEBUG [1bc30033] Command: ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.5.3" ; /usr/bin/env mkdir -p /tmp )
INFO [815d8d82] Finished in 0.099 seconds with exit status 0 (successful).
; /etc/php/7.3/fpm/php-fpm.conf
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
@excid3
excid3 / dynamic-nginx-module-ubuntu-18.04.sh
Created June 20, 2018 17:58
How to compile a dynamic nginx module for Ubuntu 18.04
# Install dependencies that nginx was originally compiled with
sudo apt install libperl-dev libgeoip-dev libgd-dev
# Get the nginx source
wget https://nginx.org/download/nginx-1.14.0.tar.gz
tar zxf nginx-1.14.0.tar.gz
# Get the module source
wget https://github.com/fdintino/nginx-upload-module/archive/master.zip
unzip master.zip
server {
listen 80;
listen [::]:80;
server_name _;
passenger_enabled on;
rails_env production;
root /home/deploy/build.gorails.com/current/public;
@excid3
excid3 / middleware.rb
Created March 5, 2018 03:14 — forked from romaimperator/middleware.rb
Middleware to support prefixed value in the url
class MyMiddleware
def initialize(app)
@app = app
@message = message
end
def call(env)
dup._call(env)
end
@excid3
excid3 / require_payment_upfront.patch
Created October 19, 2017 15:46
Stripe Payments Course: Requiring payments upfront
From e0e025f141ad50ca83c729f26a2035cf2f214262 Mon Sep 17 00:00:00 2001
From: Chris Oliver <excid3@gmail.com>
Date: Wed, 1 Feb 2017 17:19:12 -0600
Subject: [PATCH] Add stripe payments as required for registration
---
Gemfile | 1 +
Gemfile.lock | 5 +-
app/assets/javascripts/payments.js | 39 ++++++++++++++
app/controllers/application_controller.rb | 7 ++-
# Puma can serve each request in a thread from an internal thread pool.
# The `threads` method setting takes two numbers a minimum and maximum.
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum, this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
threads threads_count, threads_count
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
<%= content_tag :div, id: "team-form", data: { team: team.to_json(except: [:created_at, :updated_at]), players_attributes: team.players.to_json(except: [:team_id, :created_at, :updated_at]) } do %>
<label for="team_name">Team Name</label>
<input id="team_name" v-model="team.name" />
<h4>Players</h4>
<div v-for="(player, index) in team.players_attributes">
<div v-if="player._destroy == '1'">
{{ player.name }} will be removed
<button v-on:click.prevent="undoDelete(index)">Undo</button>
def create
@room = Room.find(params[:room_id])
@event = @room.events.create(event_params)
@event.create_recurring_events
end