Skip to content

Instantly share code, notes, and snippets.

View eclectic-coding's full-sized avatar
🏠
Working from home

Chuck eclectic-coding

🏠
Working from home
View GitHub Profile
@denmarkin
denmarkin / devise.en.yml
Created May 4, 2011 18:50
Custom overwrite for Device::SessionsController
sessions:
signed_in: 'Signed in successfully.'
signed_in_first_time: "MY CUSTOM WELCOME GREETING. DO NOT FORGET TO READ OUR GUIDELINE!"
signed_out: 'Signed out successfully.'
@billerickson
billerickson / gist:1325949
Created October 30, 2011 14:25
Grid Loop
<?php
/**
* Set up the Grid Loop
* @author Bill Erickson
* @link http://www.billerickson.net/genesis-grid-loop-content/
*
*/
function child_grid_loop_helper() {
genesis_grid_loop( array(
'features' => 2,
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@wpsmith
wpsmith / taxonomies.php
Created May 30, 2012 17:25
Registering Multiple Taxonomies
<?php
/**
* Taxonomies
*
* This file registers any custom taxonomies
*
* @package WPS_Starter_Genesis_Child
* @author Travis Smith <travis@wpsmith.net>
* @copyright Copyright (c) 2012, Travis Smith
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
@jentanbernardus
jentanbernardus / Disable_the_dashboard_welcome_screen.php
Created January 7, 2013 00:43
Hide or Replace the WordPress Welcome Panel [ functions.php ]
//Disable the dashboard welcome screen
//This will only hide the panel, not replace it with any other content.
add_filter("get_user_metadata", "my_own_welcome_panel", 1, 4);
function my_own_welcome_panel($null, $object_id, $meta_key, $single) {
if($meta_key === 'my_own_welcome_panel') { return 0; }
}
@jwo
jwo / mysql.database.yml
Last active July 10, 2024 18:15
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
@halloffame
halloffame / RubyDateFormats.md
Last active May 25, 2024 13:38
Quick reference for ruby date format abbreviations.

Date

Year

%Y - Year with century (can be negative, 4 digits at least) -0001, 0000, 1995, 2009, 14292, etc.

  • %C - year / 100 (round down. 20 in 2009)
  • %y - year % 100 (00..99)
@mikeatlas
mikeatlas / new_invitation.html.erb
Last active April 17, 2022 19:36
How to invite users in active admin with devise_invitable
<!-- /app/views/admin/users/new_invitiations.html.erb -->
<h2>Send invitation</h2>
<%= form_for @user, :url => send_invitation_admin_users_path do |f| %>
<table style='width: 50%'>
<tr>
<td><%= f.label :first_name %></td>
<td><%= f.text_field :first_name %></td>
@studiopress
studiopress / genesis-read-more.php
Last active August 10, 2020 09:51
Genesis post excerpts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the Genesis content limit read more link
add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '... <a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
}