Skip to content

Instantly share code, notes, and snippets.

@troutacular
troutacular / wp-related-by-category
Created April 6, 2016 23:33
WordPress Related by Category
@troutacular
troutacular / wp-related-links-by-tags
Created April 6, 2016 23:32
WordPress Related Links by Tags
@troutacular
troutacular / js-sass-fontello-icon.js
Created April 6, 2016 23:31
JavaScript: Fontello Demo File SASS icon generator
// source: http://codepen.io/troutacular/pen/LafsD
// include in your file http://web-app.usc.edu/fontello/fontello-variable-generator.js
( function() {
// set the main element to attach the output
var cont = document.querySelector('.footer');
// get all elements with class .the-icons
var el = document.querySelectorAll('.the-icons');
// loop through the all el returned
for (var i = 0, len = el.length; i < len; i++) {
@troutacular
troutacular / css-responsive-table.css
Created April 6, 2016 23:29
CSS Responsive Table
table {
/* remove if moving header */
display: block;
overflow: auto;
/* end */
margin: 0 0 1.5em;
width: 100%;
background-color: #fff;
border: 1px solid #000;
border-bottom: none;
@troutacular
troutacular / css-word-wrapping.css
Last active April 6, 2016 23:25
CSS: Word Wrapping
.wrapped-item {
display: inline-block;
*display: inline;
*zoom: 1;
text-overflow: ellipsis;
-ms-text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
word-wrap: normal;
max-width: 100px;
@troutacular
troutacular / gulp-inject-single-mutiple
Created November 5, 2015 22:17
Gulp Inject - Single and Multiple
gulp.task('scripts_insert', ['vendor_scripts', 'site_scripts'], function () {
var transform = function(filepath, file, i, length) {
return '<script src="' + filepath + '" async></script>';
};
return gulp.src(paths.js.template)
.pipe(inject(gulp.src(paths.js.dest.lib + '/*.js', {read: false}), {addRootSlash: false, transform: transform}))
.pipe(gulp.dest(base_paths.templates));
@troutacular
troutacular / js-mulitple-timeouts
Last active October 28, 2015 22:04
JS: Multiple Timeouts
/**
* TimeOuts
* ========
*
* Use the functions below to handle mutliple timeouts
*
* New timeout
* timeOuts['ID'] = setTimeout(someFunction('values'), 250);
*
* Clear specific timeout
@troutacular
troutacular / gist:f083fa913427044631ce
Last active October 27, 2015 20:10
Gulp Directory Structure Options
# Option 1
public/
src/
index.html
img/
js/
app.js
scss/
dist/
@troutacular
troutacular / Package Control.sublime-settings
Created October 21, 2015 22:38
Sublime 3 Package Install
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"1337 Color Scheme",
"ACF Snippets",
"Color Highlighter",
@troutacular
troutacular / kaufman-royal-slider
Created October 6, 2015 22:26
Kaufmann bad url for royalslider
orig: <iframe src="https://www.youtube.com/embed/%id%"?rel=1&autoplay=1&showinfo="0" frameborder="no"></iframe>
fix: <iframe src="https://www.youtube.com/embed/%id%?rel=1&autoplay=1&showinfo=0" frameborder="no"></iframe>