Skip to content

Instantly share code, notes, and snippets.

View tylercollier's full-sized avatar

Tyler Collier tylercollier

  • Email: github2 at my first and last name dot com
  • Phoenix, AZ, USA
View GitHub Profile
@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active April 15, 2024 20:45
Multisite: Passwort Reset on Local Blog
<?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
*/
@bubblerun
bubblerun / array.js
Created January 17, 2017 02:37
State abbreviations JavaScript array
[ 'AL', 'AK', 'AS', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FM', 'FL', 'GA', 'GU', 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MH', 'MD', 'MA', 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY', 'NC', 'ND', 'MP', 'OH', 'OK', 'OR', 'PW', 'PA', 'PR', 'RI', 'SC', 'SD', 'TN', 'TX', 'UT', 'VT', 'VI', 'VA', 'WA', 'WV', 'WI', 'WY' ];
@thechrisoshow
thechrisoshow / whitelabeling.rb
Created August 16, 2011 10:43
How should I white label a Rails app?
class ApplicationController < ActionController::Base
around_filter :set_white_label
private
def set_white_label
subdomains = request.subdomains - RESERVED_SUBDOMAINS
if subdomains.empty?
yield
return
@cupakromer
cupakromer / books_controller.rb
Last active May 19, 2020 10:20
Rails 4 Standard CRUD Controller
# 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 February 15, 2013 21:25
Rails Boolean to string yes no
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