Skip to content

Instantly share code, notes, and snippets.

@execat
execat / Environment.md
Last active March 8, 2023 16:36
Using Nix to run a Rails project

Create new Rails project $PROJECT_NAME:

$ nix-shell -p "ruby_3_0.withPackages (ps: with ps; [ rails ])" -p bundix -p sqlite \
    --run "rails new $PROJECT_NAME --skip-bundle --webpacker react && \
       cd $PROJECT_NAME && \
       bundle config set force_ruby_platform true && \
       bundle lock && \
       bundix --ruby=ruby_3_0"
@execat
execat / install.sh
Last active December 21, 2021 07:53
FreeBSD config
# Essentials
ASSUME_ALWAYS_YES=yes pkg install bash zsh git
git config --global init.defaultBranch dev
git config --global user.name "Anuj More (root)"
git config --global user.email anujmorex+root@gmail.com
cd /etc
git init .
git add .
# I am a bank.
# I need PEOPLE to give their name and open an account.
# If the account balance < 10, then send them warning email.
# If the account balance < 0, then close the account
# If the account balance > 10M, then send them a "thank you" email
# I have a customer X. X's balance is $10.
# Today: X walks in. Deposits $40. New balance $50.
# Tomorrow: X walks in. Deposits $33. New balance $83.
# After that: X walks in. Withdraws $3. New balance $80.

Keybase proof

I hereby claim:

  • I am execat on github.
  • I am execat (https://keybase.io/execat) on keybase.
  • I have a public key ASCk8fYG8pzdGIXKcSW2Q5PYdQ1MecwsPJAQf5ozsq6Lngo

To claim this, I am signing this object:

@execat
execat / Ruby_Naming_Conventions.md
Last active September 25, 2018 20:42 — forked from alexpchin/Ruby_Rails_Naming_Conventions.md
Ruby & Rails Naming Conventions

The Ruby Naming Conventions

As Jon would say, ProTip:

Ruby uses the first character of the name to help it determine it’s intended use.

Local Variables
These should be a lowercase letter followed by other characters, naming convention states that it is better to use underscores rather than camelBack for multiple word names eg. mileage, variable_xyz

Instance Variables

@execat
execat / install.sh
Last active June 19, 2018 08:28
Autosetup macOS
#!/usr/bin/env bash
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
install_thoughtbot() {
mkdir -p "$HOME/installer/logs" && cd "$HOME/installer"