Skip to content

Instantly share code, notes, and snippets.

View joebrislin's full-sized avatar

Joe Brislin joebrislin

View GitHub Profile
@eoinkelly
eoinkelly / postgres-upgrade-recipe.sh
Last active November 9, 2017 16:59
Upgrade Postgres to 9.4 using Homebrew on Mac OSX
#!/bin/bash
# This script can be used in "run & hope" mode or you can use it as a recipe to
# do things manually - you probably want the latter if you really care about
# the data in your databases.
# Happy hacking
# /Eoin/
# Tell bash to stop if something goes wrong
set -e
require 'rails_helper'
RSpec.describe TodosController, :type => :controller do
describe "GET #index" do
#describe "POST #create" do
#describe "GET #show" do
#describe "PATCH #update" do (or PUT #update)
#describe "DELETE #destroy" do
#describe "GET #new" do
@ronnieduke
ronnieduke / mura-podcast-xml.cfm
Last active November 2, 2015 23:15
How to create a podcast XML feed using Mura CMS
<!--- Add this to your {theme}/remote/podcast.cfm --->
<!--- Set your siteID --->
<!--- This is important because iTunes does not have a session to your Mura site when accessing the XML,
so you have to set the site ID manually --->
<cfset siteid='yourSiteID'>
<cfscript>
$= application.serviceFactory.getBean('$').init(siteid);
// In your Mura Architecture, you will want to create a "Show" for wach of the episodes to live under.
@suryart
suryart / application.html.erb
Last active October 26, 2023 00:16
Rails 4 flash messages using Twitter Bootstrap(bootstrap-sass: https://github.com/thomas-mcdonald/bootstrap-sass). An improved version of https://gist.github.com/roberto/3344628
// layout file
<body>
<div class="container">
<%= flash_messages %>
<%= yield %>
</div><!-- /container -->
</body>
@SabretWoW
SabretWoW / rspec_model_testing_template.rb
Last active March 7, 2024 03:56
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems:
@mattlevine
mattlevine / relatedcategoryimages.cfm
Created February 18, 2012 16:32
How to get images that match the current content nodes categories
<cfscript>
//Get current content's category assignments
rsCategories=$.content().getCategoriesQuery();
//Build a feed of images with matching categories
images=$.getBean("feed")
.setCategoryID( valueList(rsCategories.categoryID) )
.addParam(field='tcontent.type',condition="EQ",criteria='File')
.addParam(field='tfiles.fileEXT',condition="in",criteria='jpg,png,gif,jpeg')
.getIterator();