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
// log.js | |
// https://github.com/bgrins/devtools-snippets | |
// Adds a `log` function to window object. | |
// http://www.briangrinstead.com/blog/console-log-helper-function | |
(function() { | |
window.log = Function.prototype.bind.call(console.log, console); | |
})(); |
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
// jquerify.js | |
// https://github.com/bgrins/devtools-snippets | |
// Add jQuery to any page that does not have it already. | |
(function () { | |
if ( !window.jQuery ) { | |
var s = document.createElement('script'); | |
s.setAttribute('src', '//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js'); | |
document.body.appendChild(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
@keyframes "stickerShake" { | |
from { | |
-webkit-transform:rotate(0deg); | |
-moz-transform:rotate(0deg); | |
-o-transform:rotate(0deg); | |
-ms-transform:rotate(0deg); | |
transform:rotate(0deg) | |
} | |
25% { | |
-webkit-transform:rotate(-8deg); |
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 QueryStringToJSON() { | |
var pairs = location.search.slice(1).split('&'); | |
var result = {}; | |
pairs.forEach(function(pair) { | |
pair = pair.split('='); | |
result[pair[0]] = decodeURIComponent(pair[1] || ''); | |
}); | |
return JSON.parse(JSON.stringify(result)); |
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
#pullBar .fi-loop { | |
display:inline-block; | |
-moz-animation:rotate 2s linear infinite; | |
-webkit-animation:rotate 2s linear infinite; | |
animation:rotate 2s linear infinite; | |
} | |
@-moz-keyframes rotate { | |
0% { | |
-moz-transform:rotate(0deg); |
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
if ("geolocation" in navigator) { | |
navigator.geolocation.getCurrentPosition(function(position) { | |
var jingdu = position.coords.longitude, // 经度 | |
weidu = position.coords.latitude; // 纬度 | |
}); | |
} else { | |
alert('您的浏览器不支持地理位置查询!'); | |
} |
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 mergeTo = [4,5,6]; | |
var mergeFrom = [7,8,9]; | |
Array.prototype.push.apply(mergeTo, mergeFrom); | |
mergeTo; // is: [4, 5, 6, 7, 8, 9] |
NewerOlder