Skip to content

Instantly share code, notes, and snippets.

Aaron Fischer Aaronfischer

View GitHub Profile
@Aaronfischer
Aaronfischer / gist:8961255
Last active Apr 22, 2019
Lead Form Tracking
View gist:8961255
/*-------------------------------------------------------------------
*
* TRACK SOURCE WITH A COOKIE
* This will check if the query and save its values into a cookie for 180 days and will only be removed if they clear their cookies or if they visit via another source query
* ex. http://rmcad.edu/event/rmcad-create-day-0?utm_source=Social&utm_medium=Twitter&utm_campaign=CreateDay2.15
* utm_source = Social
* utm_medium = Twitter
* utm_campaign = CreateDay2.15
*
-------------------------------------------------------------------*/
@Aaronfischer
Aaronfischer / smoothscroll.js
Last active Aug 23, 2018
Smooth Scroll / Scroll to Section on Load
View smoothscroll.js
/* ----------------------------------------------------------------------------------------------------------
03 scroll to #section-id-of-div
---------------------------------------------------------------------------------------------------------- */
function smoothScroll(el, target){
// if the hash is in the URL but not on the page... ex #cosmetic-surgery but not #section-this-div
if(el !== null){
var $this = $(el),
target = el.hash,
$target = $(target);
// check if the target has an offset, if its NOT undefined then run the code to allow things to scroll
@Aaronfischer
Aaronfischer / controllers.application.js
Created Apr 18, 2018 — forked from sukima/controllers.application.js
test iterate object and change value
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thing: {
'first-name': 'Aaron',
'hello_last-name': '',
'status': '',
},
@Aaronfischer
Aaronfischer / controllers.application.js
Last active Apr 17, 2018
test iterate object and change value
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thing: {
'first-name': '',
'last-name': '',
'status': '',
},
actions: {
@Aaronfischer
Aaronfischer / adapters.application.js
Last active Jan 19, 2018 — forked from samselikoff/mirage.config.js
mirage reflexive - include error
View adapters.application.js
import DS from 'ember-data';
import UrlTemplates from 'ember-data-url-templates';
export default DS.JSONAPIAdapter.extend(UrlTemplates, {
host: '',
namespace: 'api',
urlTemplate: '{+host}/{+namespace}/{pathForType}{/id}',
});
@Aaronfischer
Aaronfischer / controllers.foo.js
Last active Jan 18, 2018 — forked from sukima/controllers.foo.js
Infinate route refresh two task approach - from @sukima
View controllers.foo.js
import Ember from 'ember';
export default Ember.Controller.extend({
people: Ember.computed.or('model.{current,previous}.value'),
isLoading: Ember.computed.reads('model.current.isRunning'),
fetchError: Ember.computed.reads('model.current.error'),
actions: {
fetchMore() {
this.send('refreshModel');
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
@Aaronfischer
Aaronfischer / gist:adf4d1d584df69c064c7
Created Jul 13, 2015
GIT - delete merged branches
View gist:adf4d1d584df69c064c7
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
db: Ember.computed('refreshDb', function() {
let dump = window.server.schema.db.dump();
return JSON.stringify(dump, null, 2);
}),
You can’t perform that action at this time.