Skip to content

Instantly share code, notes, and snippets.

var GLOBAL_NAME = {};
;(function($, window, document){
'use strict';
var PLUGIN_NAME = this.PLUGIN_NAME = function(element, options){
this.element = $(element);
this.options = $.extend({}, this.options, options);
this.initialise();
@markcarrrr
markcarrrr / Primish Class
Last active August 29, 2015 13:59
primish class
/* https://github.com/DimitarChristoff/primish/ */
/* requires: [primish.js, options.js] */
/* Example... */
var App = App = {};
;(function(Class, window, document){
"use strict";
@markcarrrr
markcarrrr / css-triangles
Last active August 29, 2015 13:59
CSS Triangles
.triangle-up {
border-bottom: 10px solid red;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
height: 0;
width: 0;
}
.triangle-down {
@markcarrrr
markcarrrr / Even number
Last active August 29, 2015 14:00
Even number
function isEven(value) {
if (value%2 === 0)
return true;
else
return false;
}
@markcarrrr
markcarrrr / Git Commands.md
Last active October 19, 2020 10:51
It's fine remembering the common day-to-day commands but here's a list of commands I use as a reference for the lesser used commands.

GIT Commands

Shallow clone

git clone --depth 1 [REPO_PATH]

Unshallow repo

git fetch --unshallow

Checkout a branch/all branches after shallow clone

git remote set-branches origin [SPECIFIC-BRANCH or * for all branches]

.widthCalc(@width, @minus) {
width: ~"-webkit-calc(@{width} - @{minus})";
width: ~"calc(@{width} - @{minus})";
}
@markcarrrr
markcarrrr / .gitconfig
Created September 17, 2014 09:35
.gitconfig - Beyond Compare
[diff]
tool = bc3
[difftool]
prompt = false
[difftool "bc3"]
cmd = \"C:/Program Files (x86)/Beyond Compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"
[merge]
tool = bc3
[mergetool]
prompt = false
@markcarrrr
markcarrrr / disable console.log
Last active August 29, 2015 14:06
JavaScript - Disable console.log
// Use snippet below to disable console.X if not supported to prevent JS errors
if(typeof console === 'undefined') {
console = {
log: function() { },
debug: function() { },
table: function() { }
};
}
@markcarrrr
markcarrrr / CLI commands.md
Last active March 11, 2018 13:36
A list of common CLI keyboard commands

Ctrl+U - Clear all left of cursor
Ctrl+C - Cancel the current command/line
Ctrl+A - Goto the beginning of the line
Ctrl+E - Goto the end of the line
Ctrl+K - Remove all to the right
Ctrl+W - Remove whole word to the left
Ctrl+Y - Reinstate deleted command
Ctrl+L - Scroll prompt to top

@markcarrrr
markcarrrr / chosen-theme-standard-multi-nosearch
Created June 21, 2016 08:58
Basic SASS styling for 'chosen' custom select for standard and multi select without search.
.chosen-container {
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
width: auto !important; // Overwrite style set with JS
ul {
margin: 0;
padding: 0;