Skip to content

Instantly share code, notes, and snippets.

View seajones's full-sized avatar

Owen C. Jones seajones

View GitHub Profile
function removeFullPageJS() {
/* Remove Fullpage.js by Alvaro Trigo
*
* Fullpage.js is a script by Alvaro Trigo, that you can find here https://github.com/alvarotrigo/fullPage.js/tree/master
* The script allows you to take over the scrolling of a website and make it scroll in one page sections
*
* On occasion, say if the user resizes their browser to a small width, you may need to remove it's functionality
*
* This Gist removes the main effects of Fullpage.js. Both the Gist and Fullpage itself rely on jQuery.
@seajones
seajones / iesafeconsolelog.js
Created August 18, 2013 13:35
IE-Safe console.log
/*
Some versions of IE have a bug that stops applications working if they use console.log and the developer window is closed.
This is obviously a fairly big issue, especially because developers will often have the dev window open, meaning that they
struggle to recreate the problems their users report.
The answer is not to check for IE, but to check that console.log actually exists before invoking it. You can do this with
if conditionals, but this isn't the most elegant solution. Here's mine.
*/
@seajones
seajones / gist:6261618
Last active December 21, 2015 06:08
Easy conversion of px to ems
// First, set a base size in the document - do this on HTML, or BODY, I tend towards HTML
html {
font-size: $base-font;
}
// Generally somewhere else (my SCSS is more structured than this, put this function (somewhere before you're going to use it)
@function ems($p, $b: $base-font) {
@return ($p / $b) * 1em; /* Because SASS/SCSS allows you to mix units, you can calculate this proportion in pixels, and then just multiply by 1em to get the o/p in ems */
}