Skip to content

Instantly share code, notes, and snippets.

View rickpeyton's full-sized avatar

Rick Peyton rickpeyton

View GitHub Profile
@rickpeyton
rickpeyton / gist:b2c8115f5536d8fa1a41
Last active August 29, 2015 14:15
Course 2: Quiz: Lesson 3
1. What's the difference between rendering and redirecting? What's the impact with regards to instance variables, view templates?
__Redirecting sends you off to a new action and clears all of your old instance variables. Rendering loads a view template. and retains your instance variables.__
2. If I need to display a message on the view template, and I'm redirecting, what's the easiest way to accomplish this?
__Use the flash[:notice] helper and store a message in it.__
3. If I need to display a message on the view template, and I'm rendering, what's the easiest way to accomplish this?
__Store the message in an instance variable and display it__
4. Explain how we should save passwords to the database.
/Users/rick/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.9.1/lib/bundler/runtime.rb:34:in `block in setup': You have already activated rspec-core 3.2.2, but your Gemfile requires rspec-core 2.99.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
# * * * * * cd /home/rick/public/dev1.rickpeyton.com/public/ && /home/rick/.rvm/wrappers/ruby-2.1.1/ruby generate.rb > /home/rick/public/dev1.rickpeyton.com/log/cron.log
require 'redcarpet/compat'
require 'yaml'
require 'date'
def yaml_load filename
yaml_string = File.read filename
YAML::load yaml_string
end

Keybase proof

I hereby claim:

  • I am rickpeyton on github.
  • I am rickpeyton (https://keybase.io/rickpeyton) on keybase.
  • I have a public key ASBDAVxBALTjY9sHMx7X8KxOyR88sEeasvV7OQN1rkrUIAo

To claim this, I am signing this object:

@rickpeyton
rickpeyton / python_aws_lambda.md
Last active February 12, 2017 19:42
Using Python with AWS Lambda

Field Dictionary

The core field dictionary provides fields that may be used across all apps. Usually you'll want to include at least this core field dictionary, along with possibly one or more app-specific field dictionaries.

Category Name Type Description Reference Req
Client client String The name of the client that triggered the event
@rickpeyton
rickpeyton / poodr-ch-1.md
Last active November 23, 2017 02:02
Notes from POODR - Practical Object Oriented Design in Ruby

Notes from Practical Object Oriented Design in Ruby

Chapter 1

The Problem Design Solves

Something will change. It always does. The customers didn’t know what they wanted, they didn’t say what they meant. You didn’t understand their needs, you’ve learned how to do something better. Even applications that are perfect in every way are not stable. The application was a huge success, now everyone wants more. Change is unavoidable. It is ubiquitous, omnipresent, and inevitable

Changing requirements are the programming equivalent of friction and gravity. They introduce forces that apply sudden and unexpected pressures that work against the best-laid plans. It is the need for change that makes design matter.

@rickpeyton
rickpeyton / Dockerfile
Created June 7, 2018 11:26
Ubuntu Build for Amber Crystal Framework
FROM ubuntu:latest
COPY sources.list /etc/apt/sources.list
RUN apt-get -y update && \
apt-get -y install \
apt-utils \
build-essential \
ca-certificates \
curl \
<?php
/**
* The base configuration for WordPress
*
* The wp-config.php creation script uses this file during the
* installation. You don't have to use the web site, you can
* copy this file to "wp-config.php" and fill in the values.
*
* This file contains the following configurations:
*
@rickpeyton
rickpeyton / concurrent_ruby_test.rb
Last active August 23, 2019 19:09
Concurrent-Ruby Promises Example
require "bundler/inline"
# https://ruby-concurrency.github.io/concurrent-ruby/1.1.4/Concurrent/Promise.html
gemfile do
source "https://rubygems.org"
gem "concurrent-ruby"
gem "http"
gem "logger"
gem "pry"