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
What’s the single MOST important thing for us to add to Podia? “If Podia had [ BLANK ], I would be the happiest person in the world”.
What else can we do better? I wish Podia would improve:
What do you find difficult or confusing in Podia?
What is the primary benefit that you have received from Podia?
How would you feel if you could no longer use Podia? Why?
@romaimperator
romaimperator / middleware.rb
Created March 4, 2018 03:59
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
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@nruth
nruth / pay_stripe_helper.rb
Last active March 7, 2023 00:21
capybara selenium webdriver stripe.js checkout test helper
# -*- encoding : utf-8 -*-
module PayStripeHelpers
# must be used with driver: :selenium (or :sauce?)
def pay_stripe
sleep(0.7) # wait for the js to create the popup in response to pressing the button
within_frame 'stripe_checkout_app' do # must be selenium
# fill_in 'card_number', with: '4242424242424242' no longer works
4.times {page.driver.browser.find_element(:id, 'card_number').send_keys('4242')}
# fill_in 'cc-exp', with: '5/2018' no longer works
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
@phudgins
phudgins / update_postgresql.sh
Last active December 23, 2015 12:49
Mac Homebrew upgrade postgres from 9.2.4 to 9.3.0
# Unload the launch_ctl (stop the server)
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
# Move the data directory
mv /usr/local/var/postgres /usr/local/var/postgres92
# Upgrade postgresql
brew update && brew upgrade postgresql
# Init the new database cluster

Devise / Warden Tagged logging

I wrote a middleware (actually two, but they do the same with different implementations) that logs information about signed in scopes in a Rails + Devise application. The solution works with multiple logins (like having a person logged both as an Admin and a User). I tested against Rails 4 and Devise HEAD, but it should work fine in any Rails 3 application.

This solution doesn't use the log_tags configuration option since it isn't very helpful when you need to retrieve information stored in cookies/session. That information isn't 'ready' when the Rails::Rack::Logger is executed, since it happens way down in the middleware chain.

Add one of the following implementations to your application load path and use the following configuration to add the middleware to your application stack:

# application.rb
@joelash
joelash / chef_solo_bootstrap.sh
Created August 30, 2012 21:45 — forked from ryanb/chef_solo_bootstrap.sh
Bootstrap Chef Solo
#!/usr/bin/env bash
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
tar -xvzf ruby-1.9.3-p125.tar.gz
cd ruby-1.9.3-p125/
./configure --prefix=/usr/local
make
make install