I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SASS variable overrides must be declared before loading up Active Admin's styles. | |
// | |
// To view the variables that Active Admin provides, take a look at | |
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the | |
// Active Admin source. | |
// | |
// For example, to change the sidebar width: | |
// $sidebar-width: 242px; | |
$primary-color: dynamic_active_admin_color(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install openssl | |
brew link --force openssl | |
gem install puma | |
ALternatively: | |
export CPPFLAGS="-I/usr/local/opt/openssl/include" | |
export LDFLAGS="-L/usr/local/opt/openssl/lib" | |
gem install puma |
TL;DR
9.4 -> 9.5:
sudo pg_dropcluster 9.5 main --stop
sudo service postgresql stop
sudo pg_upgradecluster -m upgrade -k 9.4 main
sudo su postgres -c "/usr/lib/postgresql/9.5/bin/vacuumdb --all --analyze-in-stages"
sudo pg_dropcluster 9.4 main
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Set up Rails app. Run this script immediately after cloning the codebase. | |
# Exit if any subcommand fails | |
set -e | |
# Copy over configs | |
if ! [ -f .env ]; then | |
cp .sample.env .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] } | |
source = JSON.dump(struct) | |
tokens = [] | |
index = 0 | |
until source.empty? | |
tokens << |