- RFC 2396 Uniform Resource Identifiers (URI): Generic Syntax
- RFC 3986 Uniform Resource Identifier (URI): Generic Syntax
- Living Standard URL 4.3. URL writing
- path-absolute-URL, path-relative-URL, scheme-relative-special-URL, scheme-relative-file-URL...
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
var scrolling_elem = document.scrollingElement; | |
$(scrolling_elem) | |
.filter(':not(:animated)') | |
.animate({scrollTop: 0}, {duration: 500, easing: 'swing'}); |
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
var isIE = !(window.ActiveXObject) && "ActiveXObject" in window; |
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 (typeof foo !== 'undefined') { | |
// ... | |
} |
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
var checkbox = document.querySelector('input[type="checkbox"]'); | |
checkbox.addEventListener('click', function(event) { | |
event.target.checked = false; | |
}); |
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
var original_array = ['D-1', 'D-2', 'D-3']; | |
var copied_array = original_array.concat(); | |
original_array.push('Dragoon'); | |
// original_array --> ['D-1', 'D-2', 'D-3', 'Dragoon'] | |
// copied_array --> ['D-1', 'D-2', 'D-3'] |
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
@mixin pseudo-elem-icon($width, $height, $image) { | |
content: ""; | |
width: $width; | |
height: $height; | |
display: inline-block; | |
background: url($image) no-repeat 0 0; | |
background-size: contain; | |
} | |
// Usage |
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
// Depending on jQuery and UAParser.js | |
function disablePhoneLink() { | |
var device_type = new UAParser().getDevice().type; | |
var is_not_mobile = !(device_type == 'mobile' || device_type == 'tablet'); | |
if (is_not_mobile) { | |
$('a[href^="tel:"]').each(function() { | |
$(this).addClass('is-disabled') | |
.on('click', function(event) { event.preventDefault(); }); |
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
// Node.js | |
var fs = require('fs'); | |
function func() { | |
try { | |
fs.statSync('./foo/'); | |
// operate files in the directory foo |
OlderNewer