- There are some situations that are difficult to distinguish mechanically, so I now consider all of those cases problematic, even when they are not obviously wrong.
- You should be coding for readability and error resistance.
- The place to express yourself in programming is in the quality of your ideas, and the efficiency of execution. The role of style is the same as in literature. A great writer doesn't express himself by putting the spaces before his commas instead of after, or by putting extra spaces inside his parentheses.
- Many people think they have good reasons for doing things badly.
- [The purpose of JSLint is not to make you feel good about inadequate coding standards.](http://tech.groups.y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if( ( /android/gi ).test( navigator.appVersion ) ) { | |
| console = { | |
| "_log" : [], | |
| "log" : function() { | |
| var arr = []; | |
| for ( var i = 0; i < arguments.length; i++ ) { | |
| arr.push( arguments[ i ] ); | |
| } | |
| this._log.push( arr.join( ", ") ); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery.extend = jQuery.fn.extend = function() { | |
| var options, name, src, copy, copyIsArray, clone, | |
| target = arguments[0] || {}, | |
| i = 1, | |
| length = arguments.length, | |
| deep = false; | |
| // Handle a deep copy situation | |
| if ( typeof target === "boolean" ) { | |
| deep = target; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Add this at the top of Gruntfile.js: | |
| var request = require('request'); | |
| module.exports = function(grunt) { | |
| grunt.initConfig({ | |
| // ......... | |
| // other grunt tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function( jQuery, window, undefined ) { | |
| "use strict"; | |
| var matched, browser; | |
| jQuery.uaMatch = function( ua ) { | |
| ua = ua.toLowerCase(); | |
| var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) || | |
| /(webkit)[ \/]([\w.]+)/.exec( ua ) || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 'use strict'; | |
| /** | |
| * IE8 does not support certain Javascript functions | |
| * These are added using this script | |
| */ | |
| // Add ECMA262-5 method binding if not supported natively | |
| // | |
| if (!('bind' in Function.prototype)) { | |
| Function.prototype.bind= function(owner) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * j3lte namespace object. | |
| * Creates the j3lte object without overriding previous instances of it. | |
| */ | |
| var j3lte = (j3lte === undefined) ? {} : j3lte; | |
| j3lte.namespace = function () { | |
| var a = arguments, o = null, i, j, d; | |
| for (i = 0; i < a.length; i = i + 1) { | |
| d = ("" + a[i]).split("."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function() { | |
| var fontSize, | |
| timeOut = null; | |
| /** | |
| * Start the code and add an event listener to resize. Only fire handleResize 250ms after stop resizing | |
| * @return {void} | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function img2table( img ){ | |
| var canvas = document.createElement('canvas') | |
| , ctx = canvas.getContext('2d') | |
| , table = document.createElement('table') | |
| , width = canvas.width = img.width | |
| , height = canvas.height = img.height | |
| , pixels | |
| , i, j, l1, l2 | |
| , tr, td, r, g, b |