Skip to content

Instantly share code, notes, and snippets.

View christophermlne's full-sized avatar

Christopher Milne christophermlne

View GitHub Profile
import DS from 'ember-data';
export default DS.Transform.extend({
serialize: function(deserialized) {
return deserialized;
},
deserialize: function(serialized) {
return Ember.Object.create(serialized);
@replete
replete / _lt-ie8-foundation-box-sizing.scss
Created October 21, 2013 11:42
Zurb Foundation Grid 4/5 IE7 support.
@charset "UTF-8";
/*---------------------------------------------------------------
IE6-7 Box-sizing polyfill, for Zurb ruleset
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
https://gist.github.com/replete/7082518
1) Requires box-sizing.htc from https://github.com/Schepp/box-sizing-polyfill
˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭˭*/
@replete
replete / _lt-ie9-foundation-grid.scss
Last active May 26, 2017 07:34
Foundation Zurb Grid 4/5 in IE7 & IE8.
@charset "UTF-8";
/*---------------------------------------------------------------
IE78 - Zurb Foundation 4 Grid
ˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍˍ
https://gist.github.com/replete/7082477
(an enhanced fork of https://gist.github.com/zurbchris/5068210 )
1) Make sure $row-width-px = your max large breakpoint row width (e.g. 960px)
@asimpson
asimpson / bash_function
Created October 31, 2012 18:51
This little script sets up a custom domain in MAMP and your hosts file.
function vhost {
sudo ~/.dotfiles/osx/mamp_vh.sh $1
}
@tomdale
tomdale / local-storage-array.js
Created April 28, 2014 02:12
Ember Array that writes every change to localStorage
export default Ember.ArrayProxy.extend({
localStorageKey: null,
init: function() {
var localStorageKey = this.get('localStorageKey');
if (!localStorageKey) {
throw new Error("You must specify which property name should be used to save " + this + " in localStorage by setting its localStorageKey property.");
}
@jasongoodwin
jasongoodwin / gist:fcbb575580406e6b0beb5496f8aaab63
Created November 29, 2017 15:49
Elixir Meetup - Slides - Jason Goodwin - Nov2017
---
# Functional Programming Paradigms In Elixir
- Objectives:
- Understand functional programming a bit better
- Categorize and understand approaches
- See which approaches fit which problems
- Map concepts and approaches from Scala/Haskell to elixir
---
@philfreo
philfreo / localstorage_safari_private_shim.js
Last active November 20, 2019 22:49
Don't let localStorage/sessionStorage setItem throw errors in Safari Private Browsing Mode
// Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem
// throw QuotaExceededError. We're going to detect this and just silently drop any calls to setItem
// to avoid the entire page breaking, without having to do a check at each usage of Storage.
if (typeof localStorage === 'object') {
try {
localStorage.setItem('localStorage', 1);
localStorage.removeItem('localStorage');
} catch (e) {
Storage.prototype._setItem = Storage.prototype.setItem;
Storage.prototype.setItem = function() {};
@code0100fun
code0100fun / app_controllers_sign-in.js
Created June 8, 2015 20:02
Ember Simple AUth + Ember CLI Mirage
// app/controllers/sign-in.js
import Ember from 'ember';
export default Ember.Controller.extend({
actions: {
signIn(){
this.set('errors', null);
var params = { identification: this.get('email'), password: this.get('password') };
// Redirects to index route on success (configurable in config/environment.js)
this.get('session').authenticate('simple-auth-authenticator:oauth2-password-grant', params);
@pwfisher
pwfisher / gtm-util.js
Last active April 20, 2021 19:32
Ember.js Google Tag Manager utility
// Google Tag Manager
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s);j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-ABCDEF');
// End Google Tag Manager
App.GtmUtil = {
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }