Skip to content

Instantly share code, notes, and snippets.

Jonathan Abbett jabbett

Block or report user

Report or block jabbett

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
jabbett / _form.html.erb
Last active Feb 22, 2019
ActsAsTaggableOn with collection_check_boxes
View _form.html.erb
<%= form_for(@sundae) do |f| %>
collection_check_boxes requires 4 parameters, the last two are methods that access
the value and text from the collection, respectively. Hence the need for
<%= f.collection_check_boxes(:flavor_list, valid_flavors, :first, :first) do |b| %>
<!-- FYI: I use Bootstrap 4, so I customized how the checkboxes would render -->
<div class="form-check">
<label class="form-check-label"><%= b.check_box class: 'form-check-input' %> <%= b.value %></label>
jabbett / ahoy_base.rb
Last active Apr 12, 2019
Setting up Ahoy models to use a separate datastore
View ahoy_base.rb
module Ahoy
class AhoyBase < ActiveRecord::Base
establish_connection DB_STATS
self.abstract_class = true
jabbett / bootstrap-4-popover.js
Created Nov 29, 2016
Managing popovers in Bootstrap 4
View bootstrap-4-popover.js
** This gist shows how to implement Bootstrap 4 popovers that:
** a) disappear automatically when the user clicks outside the popover
** b) only appear one at a time
// Hide other popover when new one appears
$('[data-original-title]').on('', function () {
jabbett / show.yml
Created Nov 23, 2016
Product tour definition for Abraham
View show.yml
text: "Welcome to your dashboard! This is where we'll highlight key information to manage your day."
title: "Events"
text: "If you're participating in any events today, we'll show that here."
element: ".dashboard-events"
placement: "right"
jabbett /
Last active May 19, 2016
JavaScript exercise for UI Engineer position

JavaScript exercise for UI Engineer position

Your task is to implement a view that is able to display a list of video titles using a paginated search API; in this case, Google's YouTube API.

You may use any JavaScript framework you like. At we use Backbone and Marionette, but choose Angular, Ember, etc., if that's more comfortable.

There are also many ways to approach the UX of this problem -- you can pick your favorite. For example:

jabbett / instiki.css
Last active Aug 29, 2015
Jabbett's Responsive Instiki Stylesheet
View instiki.css
** Jabbett's Responsive Instiki Stylesheet
** Make Instiki feel like a modern web application (almost).
** Replace public/stylesheets/instiki.css with this file.
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
v2.0b1 | 201101
jabbett / backbone_pushstate_router.js
Last active Dec 15, 2015 — forked from tbranyen/backbone_pushstate_router.js
Updated protocol check to respect javascript: pseudo-protocol and hash links (#foo) Updated to support IE
View backbone_pushstate_router.js
// Use absolute URLs to navigate to anything not in your Router.
// Note: this version works with IE. Backbone.history.navigate will automatically route the IE user to the appropriate hash URL
// Use delegation to avoid initial DOM selection and allow all matching elements to bubble
$(document).delegate("a", "click", function(evt) {
// Get the anchor href and protcol
var href = $(this).attr("href");
var protocol = this.protocol + "//";
// Ensure the protocol is not part of URL, meaning its relative.
You can’t perform that action at this time.