This file contains 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 arraysEqual( a, b ) { | |
if ( a !== b ) { | |
if ( !a || !b || a.length !== b.length ) { | |
return false; | |
} | |
for ( var i = a.length; i--; ) { | |
if ( a[ i ] !== b[ i ] ) { | |
return false; | |
} | |
} |
This file contains 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
Number.prototype.padding = ( function() { | |
var zeros = ( new Array( 21 ) ).join( "0" ); | |
return function( n ) { | |
var isneg = this < 0, | |
abs = ( isneg ? -this : this ) + "", | |
len = abs.length + isneg; | |
return ( isneg ? "-" : "" ) + zeros.substr( 0, n - len ) + abs; | |
}; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>currentTime + createMediaElementSource</title> | |
<meta charset="UTF-8"/> | |
</head> | |
<body> | |
<video controls src="a.wav"></video> | |
<script> | |
var vid = document.querySelector("video"), |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
void test( char a, int arr[ 2 ], char b ) { | |
printf( "%c", a ); | |
if ( !arr ) { | |
printf( "%p", arr ); | |
} else { | |
printf( "%4d, %4d, %4d", arr[ 0 ], arr[ 1 ], arr[ 2 ] ); | |
} |
This file contains 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
diff --git a/src/attributes/classes.js b/src/attributes/classes.js | |
index d0d1d98..3dd3c8b 100644 | |
--- a/src/attributes/classes.js | |
+++ b/src/attributes/classes.js | |
@@ -26,7 +26,7 @@ jQuery.fn.extend({ | |
if ( proceed ) { | |
// The disjunction here is for better compressibility (see removeClass) | |
- classes = ( value || "" ).match( rnotwhite ) || []; | |
+ classes = value.match( rnotwhite ) || []; |
This file contains 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
$( "<script>" ) | |
.text( ".jQuery-hidden { display: none !important; }" ) | |
.appendTo( "head" ) | |
; | |
$.fn.hide = function() { | |
return this.addClass( "jQuery-hidden" ); | |
}; | |
$.fn.unHide = function() { |
This file contains 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
var ie = document.documentMode; | |
if (ie) { | |
var htmlClass = " ie ie" + ie; | |
switch (ie) { | |
case 6: htmlClass += " lte6"; | |
case 7: htmlClass += " lte7"; | |
case 8: htmlClass += " lte8"; | |
case 9: htmlClass += " lte9"; | |
case 10: htmlClass += " lte10"; | |
case 11: htmlClass += " lte11"; |
This file contains 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
/* | |
[ Reminder ] | |
## List of the events | |
focus : | |
blur : | |
fullscreenchange : { isFullscreen } | |
keydown : { key } // ASCII code |
This file contains 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
## argv | |
ls | |
ls -l | |
ls -l -a | |
ls -l -a -S | |
ls -l -a -S -r | |
/bin/ls | |
/bin/ls -l | |
/bin/ls -l -a | |
/bin/ls -l -a -S |
This file contains 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 line( | |
x1, y1, | |
x2, y2, | |
r, g, b, a | |
) { | |
x1 = Math.round(x1); | |
y1 = Math.round(y1); | |
x2 = Math.round(x2); | |
y2 = Math.round(y2); | |
var dx, dy, e; |