Skip to content

Instantly share code, notes, and snippets.

# frozen_string_literal: true
source 'https://rubygems.org'
ruby '2.6.2'
gem 'rails', '~> 5.2.3'
gem 'pg', '>= 0.18', '< 2.0'
gem 'puma', '~> 3.11'
gem 'devise', '~> 4.6', '>= 4.6.2'
gem 'ahoy_matey' # for user tracking
gem 'bootsnap', '~> 1.4', '>= 1.4.3', require: false
data = []
File.open("Gemfile").each do |line|
data << line if line.size > 1 unless line.include?("#")
end
File.delete("Gemfile")
File.open("Gemfile", 'w') do |file|
data.unshift("# frozen_string_literal: true \n\n")
@freqn
freqn / README.md
Created February 28, 2019 04:25
vscode-settings

VSCode Settings

@freqn
freqn / router.ex
Last active February 28, 2019 04:04
Phoenix route scoping setup with Ueberauth
scope "/auth", Discuss do
pipe_through :browser
get "/:provider", AuthController, :request
get "/:provider/callback", AuthController, :callback
end
defmodule Discuss.TopicController do
use Discuss.Web, :controller
alias Discuss.Topic
def index(conn, _params) do
topics = Repo.all(Topic)
render conn, "index.html", topics: topics
end
@freqn
freqn / design_pattern_notes.md
Created October 26, 2018 15:13
design_pattern_notes

Architecture/Design Notes

First Points to Consider

  • Separate out the things that change from those that stay the same
    • Build systems that allow you to contain the damage
    • Build to avoid combing through code whenever a change or new functionality is needed
  • Program to an interface, not to implementation
    • Write code that is less tightly coupled to itself in the first place.
  • Program to the most general type that you can. For example, if you need need a Car class, but will also need a train, plane or boat, why not try to get away with a Vehicle class. Ruby is designed to help you program to the most general types. This also reduces the total amount of coupling in our code. In other words, design to alter the least amount of classes when a change or feature is required, making code less likely to break in the face of change.
@freqn
freqn / com.googlecode.iterm2.plist
Created August 2, 2018 14:57
iterm2 general settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
<key>AppleScrollAnimationEnabled</key>
<integer>0</integer>
@freqn
freqn / settings.itermcolors
Created August 2, 2018 14:53
iterm2 color settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.25882354378700256</real>
@freqn
freqn / .spacemacs
Created August 2, 2018 14:41
spacemacs config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@freqn
freqn / test.md
Last active July 16, 2018 21:15
nnnn

-[] aws_lb_target_group.partner_portal: 1 error(s) occurred:

-[] aws_lb_target_group.partner_portal: Error creating LB Target Group: DuplicateTargetGroupName: A target group with the same name 'partner-portal-chip-beta' exists, but with different settings status code: 400, request id: bc0f8691-893b-11e8-9f5b-3713e77d7dcc -[] aws_db_subnet_group.postgres: 1 error(s) occurred:

-[] aws_db_subnet_group.postgres: Error creating DB Subnet Group: DBSubnetGroupAlreadyExists: The DB subnet group 'chip.beta' already exists. status code: 400, request id: 0d61d300-8fc5-4344-8071-1714b29b6060 -[] aws_lb_target_group.partner_engine: 1 error(s) occurred: