Skip to content

Instantly share code, notes, and snippets.

@Haegin
Haegin / application_mailer.rb
Last active September 17, 2019 19:14
Loading a quote, passing it to the revision creation service and calling save errors with "ArgumentError: A copy of Revision::CreationService has been removed from the module tree but is still active!" when it tries to instantiate the mailer and I have no idea why.
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
helper :app_url
helper :formatting
default from: "Relay <app@#{Rails.configuration.incoming_mail_domain}>"
layout "mailer"
MAX_ATTACHMENT_SIZE = 20 * 1024 * 1024
# frozen_string_literal: true
class ApplicationMailer < ActionMailer::Base
helper :app_url
helper :formatting
default from: "Relay <app@#{Rails.configuration.incoming_mail_domain}>"
layout "mailer"
MAX_ATTACHMENT_SIZE = 20 * 1024 * 1024
@Haegin
Haegin / componentTests.js
Created October 9, 2018 15:00
Testing parts of components
const LoginForm = ({email, password, onChange, onSubmit}) => (
<div>
<p>
<label for="email">Email</label>
<input
id="email"
onChange={val => onChange('email', val)}
value={email}
/>
</p>
@Haegin
Haegin / Backstory
Created March 17, 2018 14:27
Khelden Frostwalker
I was brought up by my father, a travelling ranger who made a living carrying messages or valuables through the wilds between settlements. He never spoke much about my mother, only telling me that she died giving birth to me. It always made him sad, so I never pushed too hard.
As I grew up we moved into El-Ansk, as the roads were too dangerous for him to keep travelling now I was around. In the warmer season he'd travel up to Bay City, carrying messages for wealthy merchants or nobility to make enough money to keep us fed. During the winter the weather kept him closer to home, making shorter trips out to local seal farms, or joining a hunting party for a few weeks to bring in some extra pay. I enjoyed the independence, but fell in with a bad crowd and spent my youth causing problems for the local law enforcement along with Andy's bard.
When I was 21 my father went out on his usual summer trip, but by the time the seasons were changing he still hadn't returned. Foolishly, I decided to venture out on the nort
@Haegin
Haegin / Terraform debug output
Last active January 23, 2018 16:32
Terraform Error
2018/01/23 11:26:09 [TRACE] dag/walk: added new vertex: "aws_instance.devops"
2018/01/23 11:26:09 [TRACE] dag/walk: walking "aws_instance.devops"
2018/01/23 11:26:09 [TRACE] vertex 'root.aws_instance.devops': walking
2018/01/23 11:26:09 [TRACE] vertex 'root.aws_instance.devops': evaluating
2018/01/23 11:26:09 [TRACE] [walkRefresh] Entering eval tree: aws_instance.devops
2018/01/23 11:26:09 [TRACE] root: eval: *terraform.EvalSequence
2018/01/23 11:26:09 [TRACE] root: eval: *terraform.EvalGetProvider
2018/01/23 11:26:09 [TRACE] root: eval: *terraform.EvalReadState
2018/01/23 11:26:09 [TRACE] root: eval: *terraform.EvalRefresh
2018-01-23T11:26:09.784-0500 [DEBUG] plugin.terraform-provider-aws_v1.7.0_x4: 2018/01/23 11:26:09 [DEBUG] [aws-sdk-go] DEBUG: Request ec2/DescribeInstances Details:
@Haegin
Haegin / answers.md
Last active October 3, 2017 18:35
DB answers to get started on a side project

What's the difference between embedded (sqlite) vs non-embedded?

Embedded - another term for the database being actually a library (and thus running in the same process as your application) as opposed to: Non-embedded - DB is run as an application

For a web app, just use a non-embedded DB like Postgres. You'll run into the limitations of something like SQLite too quickly.

non-embedded(hosted/ ex- postgres) -> where does it need to live in order to communicate between an api? Should a database live on it's own machine or on the same machine as your server?

It needs to be accessible to your backend. This might be over the internet or it could be on a private network. Eventually you'll want to run them on separate machines so you can optimise machine resources accordingly (using a different AWS instance type for each for example). For a side project, it's fine to be on the same machine. Even better, use a free Heroku addon and don't worry about how to configure the DB.

@Haegin
Haegin / gist:b29d344bdb72b0bfc7cb8a855f343739
Created August 26, 2016 13:34
Installing elixir in SmartOS
pkgin update && pkgin -y install erlang git unzip
echo "Installing exenv"
git clone git://github.com/mururu/exenv.git .exenv
echo 'export PATH="$HOME/.exenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(exenv init -)"' >> ~/.bash_profile
# Restart shell
echo "Installing Elixir 1.3.2"
FROM alpine:3.4
RUN apk add --no-cache alpine-sdk automake autoconf
RUN apk add --no-cache libtool
WORKDIR /opt
RUN git clone https://github.com/armon/statsite.git && \
cd statsite && \
./bootstrap.sh && \
./configure && \
make
COPY statsite.conf /etc/statsite.conf
@Haegin
Haegin / gist:639e35d6ebe1c07fe0d2
Created March 24, 2016 13:39
Installing neovim - console output
==> Installing neovim from neovim/neovim
==> Downloading https://github.com/neovim/neovim/archive/v0.1.2.tar.gz
Already downloaded: /Library/Caches/Homebrew/neovim-0.1.2.tar.gz
==> Verifying neovim-0.1.2.tar.gz checksum
tar xvf /Library/Caches/Homebrew/neovim-0.1.2.tar.gz
x neovim-0.1.2/
x neovim-0.1.2/.asan-blacklist
x neovim-0.1.2/.ci/
x neovim-0.1.2/.ci/after_success.sh
x neovim-0.1.2/.ci/before_cache.sh
@Haegin
Haegin / application.jsx
Created January 20, 2016 15:16
Gist to show the application.jsx that's having issues with react-router v1.0.3 with React 0.14
import React from 'react';
import { render } from 'react-dom';
import { Router, Route } from 'react-router';
import App from './components/app.jsx';
class Application extends React.Component {
render() {
<Router>
<Route path="/" component={App}></Route>
</Router>