Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Bailey matt-bailey

View GitHub Profile
@craigmdennis
craigmdennis / svgo.json
Last active Feb 20, 2020
SVGo Sketch Plugin Configuration
View svgo.json
{
"comment": "This is the settings file for the SVGO Compressor Plugin. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": true,
"indent": 2,
"floatPrecision": 3,
"plugins": [
{
"name": "removeDoctype",
"enabled": true
},
@tvdsluijs
tvdsluijs / pagination.html
Created Jul 11, 2018
Better pagination for Jekyll on Github pages, also see :
View pagination.html
{% if paginator.total_pages > 1 %}
<div class="pagination">
{% if paginator.previous_page %}
<a class="ml-1 mr-2" href="{{ paginator.previous_page_path | prepend: site.baseurl | replace: '//', '/' }}">&laquo; {{site.str_previous_page}}</a>
{% else %}
<span>&laquo; {{site.str_previous_page}}</span>
{% endif %}
{% assign page_start = paginator.page | minus: site.pagination_nr %}
{% assign page_end = paginator.page | plus: site.pagination_nr %}
@kevyworks
kevyworks / prep-ncv-env.sh
Last active Jun 18, 2020
Prepare Dev Machine for: Node Composer & Laravel Valet
View prep-ncv-env.sh
# MOJAVE: https://gist.github.com/kevmt/476716bfb0383d3fda699e4fcacc6470
# install brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Terminal Aliases
echo "alias artisan='php $PWD/artisan'" >> ~/.bash_profile
echo "export NVM_DIR=~/.nvm" >> ~/.bash_profile
echo "source $(brew --prefix nvm)/nvm.sh" >> ~/.bash_profile
View mamp-to-valet.md

MAMP to Valet

One-time Dependency Setup/Configuration

Install Composer

wget https://getcomposer.org/download/1.1.0/composer.phar && chmod +x composer.phar && sudo mv /usr/local/bin/composer && composer self-update
View bling.js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
}
NodeList.prototype.__proto__ = Array.prototype;
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active Aug 7, 2020
A badass list of frontend development resources I collected over time.
View frontendDevlopmentBookmarks.md
@PizzaBrandon
PizzaBrandon / jquery.waituntilexists.js
Last active Jun 30, 2020 — forked from buu700/jquery.waituntilexists.js
Updated waitUntilExists plugin
View jquery.waituntilexists.js
;(function ($, window) {
var intervals = {};
var removeListener = function(selector) {
if (intervals[selector]) {
window.clearInterval(intervals[selector]);
intervals[selector] = null;
}
@dbushell
dbushell / htmlizr.js
Last active Dec 15, 2015
Grunt task to build HTML templates with includes (original version: https://gist.github.com/dbushell/5186122)
View htmlizr.js
/*!
*
* Copyright (c) David Bushell | @dbushell | http://dbushell.com/
*
*/
var fs = require("fs"),
path = require("path");
module.exports = function(grunt)
@dbushell
dbushell / gist:5186122
Last active Dec 15, 2015
Grunt task to build HTML templates with includes (work in progress!)
View gist:5186122
/*!
*
* Copyright (c) David Bushell | @dbushell | http://dbushell.com/
*
*/
var fs = require("fs"),
path = require("path");
module.exports = function(grunt)
@bgrins
bgrins / Log-.md
Last active Jul 28, 2020
Prevent errors on console methods when no console present and expose a global 'log' function.
View Log-.md

Javascript log Function

Every time I start a new project, I want to pull in a log function that allows the same functionality as the console.log, including the full functionality of the Console API.

There are a lot of ways to do this, but many are lacking. A common problem with wrapper functions is that the line number that shows up next to the log is the line number of the log function itself, not where log was invoked. There are also times where the arguments get logged in a way that isn't quite the same as the native function.

This is an attempt to once and for all document the function that I pull in to new projects. There are two different options:

  • The full version: Inspired by the plugin in HTML5 Boilerplate. Use this if you are writing an application and want to create a window.log function. Additionally,
You can’t perform that action at this time.