Skip to content

Instantly share code, notes, and snippets.

View rickpeyton's full-sized avatar

Rick Peyton rickpeyton

View GitHub Profile
@rickpeyton
rickpeyton / gist:dea840049ea293db885b15ece3c05ddb
Last active March 15, 2021 20:49 — forked from bryhal/gist:4129042
MYSQL: Generate Calendar Table
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@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"
<?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 / 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 \

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 / python_aws_lambda.md
Last active February 12, 2017 19:42
Using Python with AWS Lambda
@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.

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:

# * * * * * 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
/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)