Skip to content

Instantly share code, notes, and snippets.

View dwyn's full-sized avatar
🖖
greetings

dwayne. dwyn

🖖
greetings
  • ATX
View GitHub Profile
@dwyn
dwyn / mysql.database.yml
Created November 11, 2022 10:25 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@dwyn
dwyn / install.sh
Last active November 8, 2022 03:35
# curl https://gist.github.com/dwyn/58533b79ac4b6891286b1ccc65b62cb3/raw --output install.sh
#!/bin/sh
set -eufo pipefail
echo ""
echo "🤚 This script will setup .dotfiles for you."
# Copy Brewfille
curl https://raw.githubusercontent.com/dwyn/559af8a6cdbec71f1463c0b65b522fba/raw --output Brewfile
@dwyn
dwyn / Brewfile
Last active November 8, 2022 03:16
# https://github.com/Homebrew/homebrew-bundle
# https://gist.github.com/ChristopherA/a579274536aab36ea9966f301ff14f3f
tap "homebrew/cask"
tap "buo/cask-upgrade"
tap "homebrew/cask-fonts"
brew "antidote"
brew "ca-certificates"
brew "chezmoi"
@dwyn
dwyn / og-specs.md
Created October 9, 2019 19:34
OG Rails Project Specs

Specifications for the Rails Assessment

Specs:

  • Using Ruby on Rails for the project
  • Include at least one has_many relationship (x has_many y; e.g. User has_many Recipes)
  • Include at least one belongs_to relationship (x belongs_to y; e.g. Post belongs_to User)
  • Include at least two has_many through relationships (x has_many y through z; e.g. Recipe has_many Items through Ingredients)
  • Include at least one many-to-many relationship (x has_many y through z, y has_many x through z; e.g. Recipe has_many Items through Ingredients, Item has_many Recipes through Ingredients)
  • The "through" part of the has_many through includes at least one user submittable attribute, that is to say, some attribute other than its foreign keys that can be submitted by the app's user (attribute_name e.g. ingredients.quantity)
  • Include reasonable validations for simple model objects (list of model objects with validations e.g. User, Recipe, Ingredient, Item)
@dwyn
dwyn / settings.js
Last active May 6, 2021 10:00
VSCode Settings Details
{
// Editor
// When enabled, the diff editor ignores changes in leading or trailing whitespace.
"diffEditor.ignoreTrimWhitespace": true,
// Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.
"diffEditor.maxComputationTime": 5000,
// Controls whether the diff editor shows +/- indicators for added/removed changes.

You could have a few options. The possiblities are (as usual) endless with Ruby.

Option 1

This is something I whipped up really quickly. I dont love it, but I think it works. app/models/cafe.rb

scope :open_cafes, -> {
  today = Date.today.strftime("%A").downcase
 joins(:openings).where("day = ? AND status = 'open'", today) 
def some_method
This is what I would do here
end
@dwyn
dwyn / README.md
Last active May 20, 2020 05:03
WSL Install

Setting up Windows Subsystem for Linux for Development

You must be running Windows 10 to perform this procedure. If you are using a different operating system, check When should I set up a local environment to find out what setup instructions you should follow.

Note: It is no longer necessary to enable developer mode for Windows Subsystem Linux to work.

Getting Windows Ready

  1. Windows Subsystem Linux (WSL) is not automatically enabled on windows. So, to start off, we need to enable it!
@dwyn
dwyn / zshrc
Last active May 10, 2020 01:15 — forked from LukeSmithxyz/zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/dharmon/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
@dwyn
dwyn / .zshrc
Last active October 25, 2019 16:44 — forked from zanshin/.zshrc
My .zshrc file
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/dwyn/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes