Skip to content

Instantly share code, notes, and snippets.

View mdeering's full-sized avatar
👨‍💻
Computer, computer, computer

Michael Deering mdeering

👨‍💻
Computer, computer, computer
View GitHub Profile
@tom-lord
tom-lord / active_emoji.rb
Created June 25, 2018 08:49
Samples from active_emoji.rb
class Array
alias <<
alias 🈴 concat
alias 💧 drop
alias 🔁 each
alias 🈳❓ empty?
alias 🍀 sample
alias 🎲 sample
alias ♻️ shuffle
alias 👈 push
@csswizardry
csswizardry / README.md
Last active June 16, 2024 13:44
Vim without NERD tree or CtrlP

Vim without NERD tree or CtrlP

I used to use NERD tree for quite a while, then switched to CtrlP for something a little more lightweight. My setup now includes zero file browser or tree view, and instead uses native Vim fuzzy search and auto-directory switching.

Fuzzy Search

There is a super sweet feature in Vim whereby you can fuzzy find your files using **/*, e.g.:

:vs **/*<partial file name><Tab>
@benlinton
benlinton / multiple_mysql_versions_for_development.md
Last active September 5, 2024 07:31
Multiple MySQL Versions with Homebrew

Multiple MySQL Versions for Development

Options included below:

  • Using Docker docker-compose
  • Using Homebrew brew

Using Docker (recommended)

This gist was originally created for Homebrew before the rise of Docker, yet it may be best to avoid installing mysql via brew any longer. Instead consider adding a barebones docker-compose.yml for each project and run docker-compose up to start each project's mysql service.

@AhmedNadar
AhmedNadar / rails_template.rb
Last active August 29, 2015 14:15
Rails Template
module RailsTemplate
module Gem
extend self
def use(name, options={})
require_path = options[:require] || name
begin
require require_path
rescue LoadError
system "gem install #{name}"
@justinweiss
justinweiss / settings.rb
Created May 27, 2014 16:54
Simple settings for Rails
require 'yaml'
require 'erb'
require 'ostruct'
class Settings < OpenStruct
# Settings.new(:google_analytics)
def initialize(config_file_base_name)
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env])
end
@tokenvolt
tokenvolt / simple_form_bootstrap3.rb
Last active November 2, 2023 11:55
Bootstrap 3 simple form initializer
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
RangeInput
StringInput
TextInput
@tommarshall
tommarshall / simple_form.rb
Created August 22, 2013 14:58 — forked from clyfe/simple_form.rb
Bootstrap3 compatible simple_form initializer (with consistent Bootstrap 3 classes)
# http://stackoverflow.com/questions/14972253/simpleform-default-input-class
# https://github.com/plataformatec/simple_form/issues/316
inputs = %w[
CollectionSelectInput
DateTimeInput
FileInput
GroupedCollectionSelectInput
NumericInput
PasswordInput
@ryansobol
ryansobol / gist:5252653
Last active September 5, 2024 20:55
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@joslynesser
joslynesser / application.rb
Created October 4, 2012 22:15
Skipping Rack::Cache for authenticated users
# ...
config.middleware.insert_before "Rack::Cache", "SkipCache"
# ...
@andrewle
andrewle / clever-rails.rb
Created September 20, 2012 10:04
A Rails app generator tuned my common needs
#!/usr/bin/env ruby
require 'rails/generators'
require 'rails/generators/rails/app/app_generator'
require "active_support/core_ext/string/strip"
class CleverAppGenerator < Rails::Generators::AppGenerator
class_option :skip_bundle, default: true
class_option :database, default: "postgresql"
class_option :skip_test_unit, default: true, hide: true