This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ellipsis(str, charLimit) { | |
var result = []; | |
var letters = 0; | |
str.split(' ').forEach(function(word, index) { | |
if (letters < charLimit) {result.push(word)} | |
letters += word.length; | |
}); | |
console.log(result.join(' ') + ' ...'); | |
})("Hero congressman calls out conservatives on racist abortion restrictions", 40); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="styleguide-icon-grid"></div> | |
<object data="/assets/icons.svg" id="svgembed" height=0; width=0></object> | |
<script> | |
var grid = document.querySelector('#styleguide-icon-grid'); | |
var tmpl = '<div class="item"><svg class="icon"><use xlink:href="/assets/icons.svg#{id}"></use></svg><span>#{id}</span></div>'; | |
function svgloaded() { | |
var svgEmbed = document.querySelector("#svgembed"); | |
var svg = svgEmbed.getSVGDocument(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cheerio = require('gulp-cheerio'); | |
var svgmin = require('gulp-svgmin'); | |
var svgstore = require('gulp-svgstore'); | |
gulp.task('svgstore', function () { | |
return gulp | |
.src('assets/icons/*.svg') | |
.pipe(svgmin()) | |
.pipe(svgstore({ fileName: 'icons.svg', prefix: 'icon-' })) | |
.pipe(cheerio({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
// test for font-face version to load via Data URI'd CSS | |
// Basically, load WOFF unless it's android's default browser, which needs TTF, or ie8-, which needs eot | |
var fonts = ns.files.css.fontsWOFF, | |
ua = win.navigator.userAgent; | |
// android webkit browser, non-chrome | |
if( ua.indexOf( "Android" ) > -1 && ua.indexOf( "like Gecko" ) > -1 && ua.indexOf( "Chrome" ) === -1 ){ | |
fonts = ns.files.css.fontsTTF; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Bootstrap_Walker_Nav_Menu extends Walker_Nav_Menu { | |
function start_lvl( &$output, $depth ) { | |
//In a child UL, add the 'dropdown-menu' class | |
$indent = str_repeat( "\t", $depth ); | |
$output .= "\n$indent<ul class=\"dropdown-menu\">\n"; |