Skip to content

Instantly share code, notes, and snippets.

Benjamin Gazé bgaze

Block or report user

Report or block bgaze

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bgaze
bgaze / vanilla-js-window-size.js
Last active Sep 2, 2019 — forked from joshcarr/window-height-width.js
[Vanilla JS] Get window dimensions
View vanilla-js-window-size.js
const windowSize = () => {
let body = document.getElementsByTagName('body')[0];
return {
width: window.innerWidth || document.documentElement.clientWidth || body.clientWidth,
height: window.innerHeight || document.documentElement.clientHeight || body.clientHeight
};
};
@bgaze
bgaze / bash-aliases
Last active Jun 16, 2019
A collection of console dev helpers
View bash-aliases
################################################################################
# HOW TO #
# #
# Simply save this file somewhere on your computer then import it into #
# your "~/.bashrc" file : #
# #
# if [ -f ~/path/to/bash-aliases ]; then #
# . ~/path/to/bash-aliases #
# fi #
# #
@bgaze
bgaze / umd-pattern.js
Created Mar 17, 2019
Javascript Universal Module Definition pattern
View umd-pattern.js
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(["jquery"], function (jQuery) {
return (root.myfn = factory(jQuery));
});
} else if (typeof module === "object" && module.exports) {
module.exports = (root.myfn = factory(require("jquery")));
} else {
root.myfn = factory(root.jQuery);
}
@bgaze
bgaze / gulp-pipable.js
Last active Mar 17, 2019
Gulp pipable function template
View gulp-pipable.js
// Install and import through2
// npm install --save-dev through2
const through = require('through2');
// Declare the function
var myfn = function () {
return through.obj(function (input, encoding, callback) {
// Get current stream content.
let content = String(input.contents);
You can’t perform that action at this time.