Skip to content

Instantly share code, notes, and snippets.

Jared Hoyt jaredhoyt

  • Goldstar Events
  • Portland, Oregon
Block or report user

Report or block jaredhoyt

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

Keybase proof

I hereby claim:

  • I am jaredhoyt on github.
  • I am jaredhoyt ( on keybase.
  • I have a public key whose fingerprint is 58FF 2A64 9B63 53D3 C440 611F BC73 8EF8 EA27 3795

To claim this, I am signing this object:

View bug-report.rb
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
gemfile(true) do
source ''
gem 'rails', github: 'rails/rails'
jaredhoyt / pre-push
Last active Dec 24, 2015
git pre-push hook to prevent force push to master
View pre-push
#!/usr/bin/env ruby
# This script has been slightly adapted from:
class PrePushHandler
def handle
reject if force_pushing? && pushing_to_master?
jaredhoyt / gist:5725338
Last active Dec 18, 2015
View gist:5725338
namespace System.Web.Mvc.Html {
using System.Collections;
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Linq.Expressions;
public static class CheckBoxLabelExtensions {
public static MvcHtmlString CheckBoxLabel(this HtmlHelper html, string expression) {
return CheckBoxLabel(html, expression, null);
View gist:932905
App::import('Core', 'Controller');
App::import('Component', 'Email');
class ReportsShell extends Shell {
var $uses = array('PaymentException');
* Controller/EmailComponent instances.
* @var class
View gist:896608
ini_set('max_execution_time', 90);
ini_set('memory_limit', '512M');
class Payment extends AppModel {
var $actsAs = array('SoftDeletable');
var $belongsTo = array('Payer', 'Procedure');
var $validate = array(
'import' => array(
'rule' => 'validImport',
'message' => 'Please submit a valid import document.'
jaredhoyt / gist:895156
Created Mar 30, 2011
Submitting a form and reloading results via ajax (jQuery)
View gist:895156
<script type="text/javascript">
$.post(form.action, $(form).serializeArray(), function(response){
jaredhoyt / gist:876242
Created Mar 18, 2011
Shell using Email Component
View gist:876242
App::import('Core', 'Controller');
App::import('Component', 'Email');
class ExampleShell extends Shell {
function main() {
$this->Controller =& new Controller();
$this->Email =& new EmailComponent(null);
jaredhoyt / prevent-cache.js
Created Mar 16, 2011
jQuery Cache Prevention
View prevent-cache.js
// This will affect all subsequent ajax calls made with jQuery
cache: false
jaredhoyt / gist:826903
Created Feb 15, 2011
Example Permissionable usage
View gist:826903
# Controller
$job = $this->Note->Job->find('summary', array(
'conditions' => array('' => $job_id),
'contain' => array('Note.CreatedBy', 'TodoList.TodoItem.Note.CreatedBy', 'Submittal.Note.CreatedBy')
You can’t perform that action at this time.