Skip to content

Instantly share code, notes, and snippets.

View nacengineer's full-sized avatar

David Southard nacengineer

View GitHub Profile
# using https://gist.github.com/agrimm/1053502 on Mac Pro 2014
=begin
ruby-1.8.7-head 1.8.7
==============================
user system total real
Block (0) 0.210000 0.000000 0.210000 ( 0.215018)
Pre-exing proc (0) 0.240000 0.000000 0.240000 ( 0.232736)
New Symbol#to_proc (0) 0.360000 0.000000 0.360000 ( 0.360474)
Old Symbol#to_proc (0) 1.370000 0.060000 1.430000 ( 1.441742)
@nacengineer
nacengineer / How To Move.md
Last active August 29, 2015 14:16
Move from one Database style to Postgres

Rails 3.1+ can handle Multiple Connections

Create model to handle the old connection. For this example we've pivoted to the new database and will be connecting to the old database

Create an database setting in your database.yml

For the purposes of this example we're going to call it OldModel

Copy your current models to a new subdirectory in /app/models/

@nacengineer
nacengineer / cullSchedule.js
Last active February 28, 2018 17:31
Reformat Schedule on http://el-una.org/
// Copyright (c) 2017-2018, Dave Southard
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all
@nacengineer
nacengineer / Gemfile
Created April 12, 2019 16:21
Rails 5.1 Default Gemfile
source 'https://rubygems.org'
git_source(:github) do |repo_name|
repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/")
"https://github.com/#{repo_name}.git"
end
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.1.0'
@nacengineer
nacengineer / Gemfile
Last active April 12, 2019 16:51
Rails 5.2 Default Gemfile
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# ruby '2.4.6' # lock to your version should you so choose
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use Puma as the app server
@nacengineer
nacengineer / Dockerfile
Last active November 15, 2019 21:01
Typical Rails + Docker Desktop Setup
FROM ruby:2.5-alpine
RUN apk add --update \
bash \
build-base \
nodejs \
postgresql-dev \
postgresql-client \
libxml2-dev \
libxslt-dev \
alias Person
{:ok, xml} =
["people.xml"]
|> Path.join()
|> File.read()
people = Person.map(xml)
IO.inspect(people)