Skip to content

Instantly share code, notes, and snippets.

View shenst1's full-sized avatar

Andrew Shenstone shenst1

  • Plantfolio
  • Seattle, WA
View GitHub Profile
@shenst1
shenst1 / Locatables.js
Created April 4, 2019 18:35
How to retrieve all results before rendering a list when there are rate limits with DATOCMS
import React from "react"
import { Query } from 'react-apollo';
import gql from 'graphql-tag';
import ResultFeed from './result-feed'
const LOTS_OF_RESULTS_QUERY = gql`
query activitiesQuery($first: IntType, $skip: IntType) {
metaData: _allLocatablesMeta {
count
}
@shenst1
shenst1 / log from imagemappro error
Last active October 7, 2017 16:31
Image Map pro id error
(index):2511 22-pirates_01 rect-2846
image-map-pro.min.js?16494660026295667179:2 Uncaught TypeError: Cannot read property 'id' of undefined
at s.applyMouseoverStyles (image-map-pro.min.js?16494660026295667179:2)
at s.highlightShape (image-map-pro.min.js?16494660026295667179:2)
at Function.t.imageMapProHighlightShape (image-map-pro.min.js?16494660026295667179:1)
at Function.$.imageMapProEventClickedShape ((index):2512)
at s.clickShape (image-map-pro.min.js?16494660026295667179:2)
at s.handleEventEnd (image-map-pro.min.js?16494660026295667179:2)
at HTMLDivElement.<anonymous> (image-map-pro.min.js?16494660026295667179:2)
at HTMLDivElement.dispatch (theme.js?16494660026295667179:33)
@shenst1
shenst1 / style.css
Created May 2, 2017 09:58
Header fix for Lila Yoga and Massage
#header .inner .wrap {
height: 122px !important;
}
#header {
position: fixed;
height: 122px;
z-index: 1001;
}
.sticky-wrapper {
height: 122px !important;
@shenst1
shenst1 / _colors.scss
Created September 19, 2016 21:28
Select 2 styleing
$c-tango-orange: #ec731f;
$c-tacao-orange: #f0b48b;
$c-piper: #c85327;
$c-mine-shaft-black: #2d2d2d;
$c-mine-shaft-gray: #444242;
$c-thunder-black: #231F20;
$c-cod-gray: #070707;
$c-other-cod-gray: #161414;
$c-scorpion-gray: #585656;
$c-cinnabar-red: #e33643;
//this controller is not being used because i am on the wrong route.
import Ember from 'ember';
export default Ember.Controller.extend({
isEditing: false,
actions: {
editRecord() {
this.set('isEditing', true);
}
}
@shenst1
shenst1 / gist:57f6c44940945f247f47
Created June 12, 2015 20:59
Notifable polymorphic
App.Notifiable = DS.Model.extend({
notifications: DS.hasMany('notification', {async: true})
});
App.User = DS.Model.extend({
userName: DS.attr('string'),
notifications: DS.hasMany('notification', {async: true})
});
App.Notification = DS.Model.extend({
@shenst1
shenst1 / organiations.hbs
Last active August 29, 2015 14:22
Uncaught Error: More context objects were passed than there are dynamic segments for the route: dataset.index
{{#each organization in model }}
{{#each dataset in organization.datasets }}
{{#link-to 'dataset' organization dataset class="btn btn-success"}}View Content{{/link-to}}
{{/each}}
{{/each}}
// The page doesn't load and I get the error:
//Uncaught Error: More context objects were passed than there are dynamic segments for the route: dataset.index
//I'm passing in two paramaters for a route with two dynamic segments. What is wrong?
xport default Ember.Controller.extend({
needs: ['organization'],
actions: {
create: function() {
var title = this.get('title');
var organization = this.get('controllers.organization');
var dataset = this.store.createRecord('dataset', {
title: title
});
this.set('title', '');
@shenst1
shenst1 / error in todoapp
Created March 12, 2014 21:23
error in todoapp rails and angular
uninitialized constant Devise::Models::TokenAuthenticatable
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:88:in `const_get'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:88:in `block (2 levels) in devise'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:87:in `each'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:87:in `block in devise'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:114:in `devise_modules_hook!'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/devise-3.2.3/lib/devise/models.rb:84:in `devise'
/Users/andrewshenstone/Google Drive/Code/Code/todo-rails4-angularjs/app/models/user.rb:2:in `<class:User>'
/Users/andrewshenstone/Google Drive/Code/Code/todo-rails4-angularjs/app/models/user.rb:1:in `<top (required)>'
/Users/andrewshenstone/.rvm/gems/ruby-2.0.0-p353/gems/activesupport-4.0.0/lib/activ
@shenst1
shenst1 / gemversionerrors
Created January 14, 2014 18:37
Error output for jasmine-jquery specs v2.0 standalone and gem errors
1 spec, 1 failure
Spec List | Failures
My Feature should add numbers
TypeError: Expecting a function in instanceof check, but got 2
TypeError: Expecting a function in instanceof check, but got 2
at Array.<anonymous> (http://localhost:8888/__spec__/helpers/jasmine-jquery.js:722:25)
at eq (http://localhost:8888/__jasmine__/jasmine.js:1794:48)
at Object.equals (http://localhost:8888/__jasmine__/jasmine.js:1745:14)
at compare (http://localhost:8888/__jasmine__/jasmine.js:2107:28)
at Expectation.toEqual (http://localhost:8888/__jasmine__/jasmine.js:1192:35)