Skip to content

Instantly share code, notes, and snippets.

View Brandon-Lyons's full-sized avatar

Brandon Lyons Brandon-Lyons

View GitHub Profile
@Brandon-Lyons
Brandon-Lyons / gist:b7ba9988f8ca9692b6d53cdcc38c52f0
Created June 5, 2020 21:26
List of commands to fix possible mysql issues
brew services stop mysql
brew unlink mysql
brew uninstall mysql
rm -rf /usr/local/var/mysql
brew list
sudo rm /usr/local/mysql
sudo rm -rf /usr/local/mysql*
sudo rm -rf /Library/StartupItems/MYSQLCOM
sudo rm -rf /Library/PreferencePanes/My*
rm -rf ~/Library/PreferencePanes/My*
@Brandon-Lyons
Brandon-Lyons / slack-dark-theme-lyons.css
Last active August 7, 2019 14:00
My Slack dark theme
@import url('https://fonts.googleapis.com/css?family=Muli&display=swap');
body {
font-family: 'Muli', sans-serif !important;
text-rendering: optimizeLegibility important;
word-spacing: -1px;
-webkit-font-smoothing: auto;
}
.supports_custom_scrollbar #msg_input.texty_legacy .ql-editor{
font-family: 'Muli', sans-serif !important;
// First make sure the wrapper app is loaded
document.addEventListener("DOMContentLoaded", function() {
// Then get its webviews
let webviews = document.querySelectorAll(".TeamView webview");
// Fetch our CSS in parallel ahead of time
const cssPath = 'https://raw.githubusercontent.com/Nockiro/slack-black-theme/3ea2efdfb96ccc91549837ab237d57104181bbf8/custom.css';
let cssPromise = fetch(cssPath).then(response => response.text());
They are several changes that the new design requires.
1. Reorganizing †he SignUpForm component:
I'm taking the SignUpForm component and breaking it down into smaller child components organized by the sections in the new design. This will make the components easier to handle and we can better achieve the design.
2. Tracking state
There is data from the form that we must keep track of for features of the new design. For example, when the user selects an education level, the background of the page must change and the tab shows Studying/Teaching in #{eduactaion_level}. We will keep track of these changes by passing the state from the child components to the parent component (SignUpForm) which will keep the state and display it appropriately.
3. Filter Institutions by Education Level
To filter by education level we must first collect the attribute to filter on. After talking with Jason Justice, he suggested using the kind attribute from the ringgold list and look for "academic" (for higher ed) and "school"
Rails.application.routes.draw do
require 'sidekiq/web'
devise_for :admin_users, ActiveAdmin::Devise.config
ActiveAdmin.routes(self)
get '/sidekiq/admin/login' => redirect('/admin')
authenticate :admin_user do
mount Sidekiq::Web => '/sidekiq'
end
devise_for :users, controllers: { sessions: "sessions", registrations: "registrations" }
require 'carrierwave/processing/mini_magick'
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::MiniMagick
IMAGE_EXTENSIONS = %w(jpg jpeg gif png)
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls)
def store_dir
"files/#{model.id}"
/Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/formatters.rb:207:in `require': cannot load such file -- j_unit (LoadError)
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/formatters.rb:207:in `rescue in custom_formatter'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/formatters.rb:204:in `custom_formatter'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/formatters.rb:167:in `find_formatter'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/formatters.rb:127:in `add'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration.rb:672:in `add_formatter'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:108:in `block in load_formatters_into'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspec-core-3.1.7/lib/rspec/core/configuration_options.rb:108:in `each'
from /Users/apps/.rvm/gems/ruby-2.1.0/gems/rspe
@Brandon-Lyons
Brandon-Lyons / gist:e6fa63bd662856acd07e
Last active August 4, 2022 19:00
New mac setup for rails development
Apps that I use:
Sublime Text: text editor
script to install package control:
import urllib.request,os,hashlib; h = '7183a2d3e96f11eeadd761d777e62404' + 'e330c659d4bb41d3bdf022e94cab3cd0';
pf = 'Package Control.sublime-package';
ipp = sublime.installed_packages_path();
urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) );
by = urllib.request.urlopen( 'http://sublime.wbond.net/' + pf.replace(' ', '%20')).read();
dh = hashlib.sha256(by).hexdigest();
print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
class College < ActiveRecord::Base
include IPEDValueConverters
has_many :college_coach_contacts
has_many :interested_athletes, :through => :preferred_colleges_join, :class_name => "Athlete", :source => :athlete, :uniq => true
has_many :preferred_colleges_join, :class_name => "PreferredCollege", :uniq => true
scope :active, -> { where active: true }
scope :inactive, -> { where active: false }
@Brandon-Lyons
Brandon-Lyons / gist:b6d9e815d0a30041730a
Created October 2, 2014 17:43
more not found colleges
[3535,
3546]