Skip to content

Instantly share code, notes, and snippets.

View markelog's full-sized avatar
😀
set your status

Oleg Gaidarenko markelog

😀
set your status
View GitHub Profile
```sh
$ grunt
Running "concat:dist" (concat) task
File dist/jquery-migrate.js created.
Running "uglify:all" (uglify) task
>> 1 file created.
Running "jshint:dist" (jshint) task
>> 1 file lint free.
/*!
* jQuery JavaScript Library v3.0.0-pre
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* http://jquery.org/license
@markelog
markelog / json
Created November 4, 2015 19:24
babel ast
[
{
"type": "FunctionDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
{
configure: ...
getOptionName: ...
check: ...
format: /* global function for whitespace imported through `require` */
// or
format: /* string option "whitespace" which would signify what kind of manipulation should be done */
// or
format: /* "complicated" format function for hard to do rules */
@markelog
markelog / gist:752e53faf9f27de4024d
Last active August 29, 2015 14:07
new format for jscs
// Deprecate and remove:
/*
* (require | disallow)SpacesInFunctionExpression
* (require | disallow)requireSpacesInFunction
*/
{
options: {
additionalRules: [],
plugins: [],
fileExtensions: [],
@markelog
markelog / gist:bf9059f816d366c552c8
Created October 1, 2014 18:39
new approach to jscs config
{
codeBlocks: {
curlyBraces: {
operators: true || [],
expect: [ "return", "break" ]
},
newlineBefore: {
statements: true,
expect: [ "for..of", "for" ]
@markelog
markelog / gist:42d43a489afb7201ddd6
Created September 28, 2014 12:17
More of jQuery.xhr
// See http://api.jquery.com/jQuery.ajax/#entry-examples
$.xhr( "some.php" )
.method( "POST" )
.send({ name: "John", location: "Boston" })
.then(function( xhr ) {
alert( "Data Saved:" + xhr.responseText );
});
$.xhr( "test.html" )
@markelog
markelog / gist:762c2584b53cace10fb3
Created August 27, 2014 13:38
jscs, js-file, context
file.iterateTokensByType("type", function() {
file === this // true
});
it('should not require between simple arguments', function() {
assert(checker.checkString('foo(a,b);').getErrorCount() === 2);
assert(checker.checkString('foo( a,b);').getErrorCount() === 1);
assert(checker.checkString('foo( a,b );').isEmpty());
});
it('should not require spaces for empty arguments list', function() {
assert(checker.checkString('foo();').isEmpty());
});
@markelog
markelog / gist:7407ac01a054cdbf0cc5
Created July 21, 2014 15:53
jQuery.xhr options
$.xhr( "url", {
method: "post",
timeout: 1000,
});
// Same as
$.xhr( "url" ).method( "post" ).timeout( 1000 )