Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
Greetings

dwayne. dwyn

👾
Greetings
View GitHub Profile
View cafe_ideas.md

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) 
@dwyn
dwyn / settings.js
Last active Oct 1, 2020
VSCode Settings Details
View settings.js
{
// 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.
View gist:73ca80331ed376de8dc5a7eee94d9b9f
def some_method
This is what I would do here
end
@dwyn
dwyn / README.md
Last active May 20, 2020
WSL Install
View README.md

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!
View 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 / og-specs.md
Created Oct 9, 2019
OG Rails Project Specs
View og-specs.md

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 / notes.md
Last active Sep 17, 2019
Example notes.md for Rails project planning.
View notes.md
Hey there, here is an example notes.md set up 😊

App Summary

My app idea is my_app_name. It will do all the things and it will be awesome! Your notes.md doesn't need to be as formatted as this example. What's most important is that you get your ideas down.

Schema

User

attribute attribute type
View rails-bootstrap-install.md
  1. Add gem 'bootstrap' to your gemfile.

  2. Add gem 'jquery-rails' to your gemfile.

  3. rename the application.css file to application.scss (located in app/assets/stylesheets/application.css)

  4. Add '@import "bootstrap";` to your application.scss file

  5. Add to your application.js file. ( located at app/assets/javascripts/application.js)

@dwyn
dwyn / gist:6d09cd1a6b714bb29fc6ad409fbf1729
Created Jul 18, 2019 — forked from ryandeussing/gist:5667094
Find and kill a zombie shotgun server
View gist:6d09cd1a6b714bb29fc6ad409fbf1729
$ ps ax | grep shotgun
11152 s000 R+ 0:00.00 grep shotgun
10766 s001 S+ 0:00.60 /Users/ryandeussing/.rvm/gems/ruby-1.9.3-p429@sinatra/bin/shotgun
$ kill -9 10766
#done
@dwyn
dwyn / .zshrc
Last active Oct 25, 2019 — forked from zanshin/.zshrc
My .zshrc file
View .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/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
You can’t perform that action at this time.