Skip to content

Instantly share code, notes, and snippets.

View amandasaffer's full-sized avatar
😘
always working

Amanda Saffer amandasaffer

😘
always working
  • SuitShop
  • Boulder, CO
View GitHub Profile
@amandasaffer
amandasaffer / truncate.js
Last active April 19, 2016 04:57
Pretty Truncate Function
function truncate(str, length) {
if (str.length > length + 3) { /* there needs to be some room for the ellipses */
str = str.substring(0, length);
lastChar = str.substring(str.length - 1);
// while lastChar is period or space, chop string more
while (lastChar === "." || lastChar === " ") {
str = str.substring(0, str.length - 1);
lastChar = str.substring(str.length - 1);
}
@amandasaffer
amandasaffer / susy-standard.scss
Last active April 12, 2016 21:24
Susy Standard
/* Set up Grids */
$susy: (
container: 100%,
columns: 16,
column-width: 50px,
gutters: 1/2,
gutter-position: inside
);
@mixin clearfix {
@amandasaffer
amandasaffer / sass-bp-helpers.scss
Last active March 17, 2016 00:48
Sass Breakpoint Helpers
// BREAKPOINTS
@mixin bp($break) {
@if $break == xlarge {
@media (min-width: 1700px) { @content; }
}
@if $break == large {
@media (min-width: 1200px) { @content; }
}
@else if $break == medium {
@media (min-width: 992px) { @content; }
html {
font-size: 62.5%;
}
body {
font-size: 1.6em;
line-height: 1.625;
}
h1 { font-size: 6.777rem; }
h2 { font-size: 5.483rem; }
@amandasaffer
amandasaffer / meteor_ionic_rating.js
Created November 17, 2015 01:58
Turn a rating decimal from Google Places API into a 5-star rating using Ionicons
Template.registerHelper('getStars', function(rating) {
var str = '';
var rating = rating.toString();
var substr = rating.split('.');
var decimal = substr[1];
// put full stars for whole number before the decimal
for(i = 0; i < substr[0]; i++) {
str += '<i class="icon ion-ios-star"></i>';
count++;