Skip to content

Instantly share code, notes, and snippets.

@alekskorovin
alekskorovin / easy-console.js
Created December 18, 2016 18:05 — forked from nuxodin/easy-console.js
Like to write to the console like this "console = xyz" instead of "console.log(xyz)" ?
!(function(){
var original = console;
Object.defineProperty(window, 'console', {
get:function(){
return original;
},
set:function(value){
original.log(value)
}
})
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@alekskorovin
alekskorovin / array-loop.js
Created October 27, 2014 15:02
With underscore
var arr = [1, 2, 3, 4];
var consoleLogEach = function(element, index, list) {
console.log(element);
}
_.each(arr, consoleLogEach);
// NOTE: I added the .js extension to this gist so it would have syntax highlighting. This file should have NO file extension
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
@alekskorovin
alekskorovin / form-label-width-fix.less
Created September 25, 2014 16:01
cross browser fix of label width which is inside of form
@-moz-document url-prefix() {
fieldset {
display: table-cell;
}
}
fieldset {
min-width: 0;
label {
display: block;
padding: 14px 0;
@alekskorovin
alekskorovin / scrollTop-scrollLeft.js
Created April 18, 2014 10:26
CrossBrowser scrollTop, scrollLeft
var x = (window.pageXOffset !== undefined) ? window.pageXOffset : (document.documentElement || document.body.parentNode || document.body).scrollLeft;
var y = (window.pageYOffset !== undefined) ? window.pageYOffset : (document.documentElement || document.body.parentNode || document.body).scrollTop;
@alekskorovin
alekskorovin / google-fonts-fix-for-chrome.css
Created April 4, 2014 13:16
Google Fonts fix for Chrome
body {
-webkit-animation-delay: 0.1s;
-webkit-animation-name: fontfix;
-webkit-animation-duration: 0.1s;
-webkit-animation-iteration-count: 1;
-webkit-animation-timing-function: linear;
}
@-webkit-keyframes fontfix {
from { opacity: 1; }
@alekskorovin
alekskorovin / starter.js
Created March 24, 2014 17:28
JS starter
(function () {
"use strict";
// Keep things tidy
// Your code goes here
}());
@alekskorovin
alekskorovin / meta-mobile.html
Created March 24, 2014 09:32
Useful Meta-Tags for a websites, also with a supporting of a mobile devices
<!-- Indicator of compatibility with a mobile devices. Declaration about a displaying of
a document without auto-scaling -->
<meta name="HandheldFriendly" content="True" />
<!-- Mobile IE is allows to activate ClearType technology for an aliasing of fonts -->
<meta http-equiv="cleartype" content="on" />
<!--This meta-tag is giving a resolution for an opening an app in a fullscreen mode
https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta charset='UTF-8'>
<meta name='keywords' content='your, tags'>
<meta name='description' content='150 words'>
<meta name='subject' content='your website's subject'>
<meta name='copyright' content='company name'>