Skip to content

Instantly share code, notes, and snippets.

View Minasokoni's full-sized avatar
:octocat:

Robert Barnwell Minasokoni

:octocat:
View GitHub Profile
<!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 */
@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');
}
}
@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');
}
});
@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);
}
@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; }
}
//Update google Analytics - client side
$window._gaq.push(['_trackPageview', $location.path()]);
//reload DFP banners
googletag.pubads().refresh();
var bgColor = '#163596',
bgImg = 'http://i.imgur.com/7MDjqNU.jpg';
var space = window.parent.document.body,
ad = space.querySelectorAll('#AD'),
adClickURL = '%%CLICK_URL_UNESC%%';
space.style.backgroundColor = bgColor;
space.style.backgroundImage = 'url(%%VIEW_URL_UNESC%%' + bgImg + '?v=%%CACHEBUSTER%%)';
@Minasokoni
Minasokoni / vhost
Created August 13, 2014 17:01 — forked from gistwebdev/vhost
#!/bin/bash
#
# Display usage info
vhost-usage() {
cat <<"USAGE"
Usage: vhost [OPTIONS] <name>
-h|--help this screen
-pub to create the webhost root in ~/www/name/public/
-url to specify a local address, default is http://name.local
Handlebars.registerHelper ('truncate', function (str, len) {
if (str.length > len) {
var new_str = str.substr (0, len+1);
while (new_str.length) {
var ch = new_str.substr ( -1 );
new_str = new_str.substr ( 0, -1 );
if (ch == ' ') {
break;
@Minasokoni
Minasokoni / genesis
Last active September 3, 2019 05:09
New Computer Setup
#!/bin/bash
# Don't forget to chmod a+x genesis.sh
# Install Homebrew + Cask
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
brew install cask
brew update && brew upgrade brew-cask && brew cleanup