Skip to content

Instantly share code, notes, and snippets.

View Minasokoni's full-sized avatar
:octocat:

Robert Barnwell Minasokoni

:octocat:
View GitHub Profile
//Update google Analytics - client side
$window._gaq.push(['_trackPageview', $location.path()]);
//reload DFP banners
googletag.pubads().refresh();
@mixin breakpoint($point) {
@if $point == desktop {
@media (min-width: 70em) { @content; }
}
@else if $point == laptop {
@media (min-width: 64em) { @content; }
}
@else if $point == tablet {
@media (min-width: 50em) { @content; }
}
@mixin gradient($from, $to) {
background-color: $from;
background-image: -moz-linear-gradient($from, $to);
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from($from), to($to));
background-image: -webkit-linear-gradient($from, $to);
background-image: -o-linear-gradient($from, $to);
}
@Minasokoni
Minasokoni / gist:d6819774822a1ba64586
Created June 10, 2014 16:45
Update document title
App.ArtistSongsRoute = Ember.Route.extend({
(...)
afterModel: function(model) {
var artistName = this.modelFor('artist').get('name');
$(document).attr('title', artistName + ' songs - Rock & Roll');
}
});
@Minasokoni
Minasokoni / gist:f3bd9e625b622273ba1f
Last active August 29, 2015 14:02
Ember toggle example
App.SidePanelComponent = Em.Component.extend({
tagName: 'div',
classNames: ['blah'],
classNameBindings: ['isOpen:opened:closed'],
isOpen: false,
actions: {
toggleSidepanel: function(){
this.toggleProperty('isOpen');
}
}
<!DOCTYPE html>
<!--[if IE 8]> <html lang="sv-SE" class="no-js ie8"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="sv-SE" class="no-js"> <!--<![endif]-->
<head>
<meta charset="UTF-8">
<title>Breakpoint detection test</title>
<style type="text/css" media="screen">
@media screen and (min-width: 320px) {
#page:after {
content: 'smallest'; /* represent the current width-bracket */