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 / gist:6d09cd1a6b714bb29fc6ad409fbf1729
Created July 18, 2019 22:26 — forked from ryandeussing/gist:5667094
Find and kill a zombie shotgun server
$ 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
  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 / notes.md
Last active September 17, 2019 19:15
Example notes.md for Rails project planning.
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
@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
@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 / 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!
def some_method
This is what I would do here
end

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 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.
@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)