Skip to content

Instantly share code, notes, and snippets.

Tyler Collier tylercollier

  • Email: github2 at my first and last name dot com
  • Phoenix, AZ, USA
Block or report user

Report or block tylercollier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active Oct 7, 2019
Multisite: Passwort Reset on Local Blog
View wordpress-passwort-reset-unmultisite.php
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/
@cupakromer
cupakromer / books_controller.rb
Last active Sep 22, 2019
Rails 4 Standard CRUD Controller
View books_controller.rb
# No flash messages are set with this controller.
#
# This is a fairly basic / bare controller which does only the basic CRUD.
class BooksController < ApplicationController
respond_to :html, :xml, :json
before_action :set_book, only: [:show, :edit, :update, :destroy]
def index
respond_with @books = Book.all
@pehrlich
pehrlich / boolean.rb
Created Feb 15, 2013
Rails Boolean to string yes no
View boolean.rb
class TrueClass
def to_s(style = :boolean)
case style
when :word then 'yes'
when :Word then 'Yes'
when :number then '1'
else 'true'
end
end
end
@thechrisoshow
thechrisoshow / whitelabeling.rb
Created Aug 16, 2011
How should I white label a Rails app?
View whitelabeling.rb
class ApplicationController < ActionController::Base
around_filter :set_white_label
private
def set_white_label
subdomains = request.subdomains - RESERVED_SUBDOMAINS
if subdomains.empty?
yield
return
You can’t perform that action at this time.