Skip to content

Instantly share code, notes, and snippets.

View paulcsmith's full-sized avatar

Paul Smith paulcsmith

View GitHub Profile
@jwoertink
jwoertink / 00_notes.txt
Last active February 15, 2019 05:33
Our production deployment setup for deploying Lucky on to Elastic Beanstalk in production.
We develop locally on MacOS. Due to some issues with cross compilation, we build the crystal binary on docker locally,
then zip that up and ship that along with the docker stuff to elasticbeanstalk.
@phillipsj
phillipsj / lucky-install.sh
Last active March 2, 2019 19:24
Install Lucky Framework, assumes Crystal is already installed.
#! /bin/bash
# Setup Node Deps
sudo snap install node --channel=11/stable --classic -y
# Configure node to use home directory for npm modules
wget -O- https://raw.githubusercontent.com/glenpike/npm-g_nosudo/master/npm-g-nosudo.sh | sh
# Install Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
class SessionForm < LuckyRecord::VirtualForm
virtual email : String
virtual password : String
def submit
user = find_user
validate_required email, password
validate_user_and_password_match(user)
yield self, user
@jarecoo
jarecoo / uncorrelated_facts.md
Last active December 14, 2018 04:28
A Quiz of the "Uncorrelated Facts" related to The Church Of Jesus Christ of Latter-day Saints
  1. What was Joseph Smith up to before he started translating the BoM and founding the church? Did he get into any trouble for that?
  2. How many first vision accounts are there? How are they different?
  3. How has the Church portrayed, in official art, the translation of the BoM? How did JS actually do it? What role did the golden plates play? How does this relate to his pre-church days?
  4. What is a seer stone? What did the church teach about Joseph Smith and seerstones prior to ~2000? When did the first photograph of the Jospeh Smith’s seerstone surface from the church?
  5. What 2 works of 19th century literature is the BoM most similar to? How are they similar? How significant, percent-the-same, are the similarities compared to other literature of the time? How much access did JS likely have to these texts?
  6. What are the kinderhook plates? How did JS do at translating them?
  7. Did the witnesses of the BoM see the physical plates?
  8. Name 3 anachronisms in the BoM.
  9. Name 4 pieces of archeological evidence
@paulcsmith
paulcsmith / Params
Created November 5, 2018 02:04
Params
Lucky::Params.new.set(:user, name: "paul")
@revgum
revgum / Dockerfile
Last active February 27, 2022 15:41
Lucky Framework Docker Development
FROM revgum/lucky
RUN mkdir /data
WORKDIR /data
ADD . /data
EXPOSE 5000
@JoelQ
JoelQ / non_empty_array.rb
Created August 9, 2018 17:30
Creating a non-empty array in Ruby
class NonEmptyArray
include Enumerable
def initialize(first, rest)
@first = first
@rest = rest
end
def first
@first
class Home::IndexPage < MainLayout
def content
Kilt.embed "my_page.slang", io_name: @view
end
end
@r00k
r00k / retro-questions.md
Last active May 27, 2022 21:59
Helpful retrospective (retro) questions

Retro Questions

  • KPI dashboard review
  • Since our last retro, what's gone well?
  • How do we feel about our productivity and work/life balance
  • How is the product better than last week?
  • How is the company better than last week?
  • Is there anything we should ask a consultant about?
  • How is the office/ops?
  • How can we enjoy the journey more?
@paulcsmith
paulcsmith / an_action_that_requires_sign_in.cr
Last active March 8, 2018 21:22
For sign up and sign in (authentication)
class Somethings::Index < BrowserAction
before require_sign_in
action { "do stuff" }
# You can extract all this to a module since you'll likely use it in multiple places
# Probably in src/pipes/authentication.cr or something
private def require_sign_in
if signed_in?