Skip to content

Instantly share code, notes, and snippets.

View invmatt's full-sized avatar

Matt Saxon invmatt

View GitHub Profile
@invmatt
invmatt / gruntfile.js
Last active August 29, 2015 13:56
Concatinates sass (using compass) and outputs production (minified) and dev (expanded) files, lints the production CSS and smushes images.
/**
* Default Grunt File
* @version 0.1.0
* @description Concatinates sass and outputs production and dev, lints the production CSS, smushes images
*/
module.exports = function(grunt) {
grunt.initConfig({
@invmatt
invmatt / sublime.json
Created February 21, 2014 13:35
Personal user settings for Sublime Text
{
"always_show_minimap_viewport": true,
"auto_find_in_selection": true,
"bold_folder_labels": false,
"close_windows_when_empty": false,
"color_scheme": "Packages/User/GrandsonOfObsidian (SL).tmTheme",
"copy_with_empty_selection": false,
"create_window_at_startup": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"drag_text": false,
$zindex: (
modal : 9000,
overlay : 8000,
dropdown : 7000,
header : 6000,
footer : 5000
);
.header {
z-index: map-get($zindex, header);
// JQuery Plugin Starter
// ----------------------------------------------------
// Setup a namespace we can use for data, events etc.
// Wraps methods internally with support for arguments.
//
// $('div').myplugin(); //call init
// $('div').myplugin({color:'green'}).fadeIn(); //init with options and chained
// $('div').myplugin('destroy'); //custom method
// $('div').myplugin('custom',10,2); //custom method with arguments
//
@invmatt
invmatt / sublime_settings
Created October 15, 2014 08:45
sublime user settings
{
"always_show_minimap_viewport": true,
"auto_find_in_selection": true,
"bold_folder_labels": false,
"close_windows_when_empty": false,
"copy_with_empty_selection": false,
"create_window_at_startup": false,
"dictionary": "Packages/Language - English/en_GB.dic",
"drag_text": false,
"file_exclude_patterns":
@invmatt
invmatt / ukmap.svg
Created September 15, 2015 10:08
Map of the UK with county classes. Jersey has been blown up by approx 150%.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@invmatt
invmatt / _grid.scss
Last active September 19, 2016 15:58
CSSWizardry grid system. Switched worded grid names for numbers. This Gist can be installed via NPM using npm install gist:a8c8ebc1d6317882633e --save-dev
/**
* CSSW Grid System
* Based off https://github.com/csswizardry/csswizardry-grids
*
* Modified to change word based class system to numbered & additional tidyup
*/
$class-type: if($use-silent-classes, unquote("%"), unquote("."));
@invmatt
invmatt / functionality.js
Last active May 7, 2019 14:03
Medium style image loading.
window.onload = function() {
var placeholder = $('.progressive-media'),
small = $('.progressive-media__small');
var img = new Image();
img.src = small.src;
img.onload = function () {
small.classList.add('loaded');
};
@invmatt
invmatt / getsetcookies.js
Created May 5, 2016 09:55
Quick way to set/get cookies in JS
/**
* Set/Get cookie functions
* setCookie('test','1');
* getCookie('test');
*/
function setCookie(key, value) {
var expires = new Date();
expires.setTime(expires.getTime() + (1 * 24 * 60 * 60 * 1000));
document.cookie = key + '=' + value + ';expires=' + expires.toUTCString();
@invmatt
invmatt / flex-grid.scss
Created October 6, 2016 11:22
Stupidly simple grid
.flex-grid {
display: flex;
flex-wrap: wrap;
margin: -0.5em;
& > * {
flex: 1 0 5em;
margin: 0.5em;
}
}