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() { | |
return !!document.createElementNS && !!document.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect; | |
}()); |
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() { | |
var div = document.createElement("div"); | |
div.innerHTML = "<svg/>"; | |
return !!div.firstChild && div.firstChild.namespaceURI === "http://www.w3.org/2000/svg"; | |
}()); |
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() { | |
var timeouts = []; | |
var messageName = "zero-timeout-message"; | |
function handleMessage(event) { | |
if (event.source === window && event.data === messageName) { | |
event.stopPropagation(); | |
if (timeouts.length > 0) { | |
var fn = timeouts.shift(); | |
fn(); |
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
# list deleted files | |
git log --diff-filter=D --summary | |
# find last commit that affected a file | |
git rev-list -n 1 HEAD -- path/to/filename | |
# restore one specific deleted file |
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
sudo /Applications/Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume /Volumes/Untitled --applicationpath /Applications/Install\ OS\ X\ Mavericks.app --nointeraction |
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
javascript:void(function() { | |
var metaViewport = document.querySelector("meta[name=viewport]"); | |
if (metaViewport) { | |
var content = metaViewport.getAttribute("content").replace("device-width","1024"); | |
metaViewport.setAttribute("content", content); | |
} | |
})(); |
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
javascript:void(function() { | |
var chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; | |
var password = ""; | |
for (var i = 0, length = 64; i < length; ++i) { | |
password += chars[~~(Math.random() * chars.length)]; | |
} | |
var input = document.getElementById("f773da90-5044-11e3-8f96-0800200c9a66") || document.createElement("input"); | |
if (!input.id) { | |
input.id = "f773da90-5044-11e3-8f96-0800200c9a66"; | |
input.setAttribute("style", "background:deeppink;border:2px solid #000;border-radius:.25em;box-shadow:0 0 1em .25em rgba(0,0,0,.5);color:#fff;position:fixed;top:1em;left:1em;font:16px/1 Helvetica,sans-serif;padding:.5em;z-index:9999;opacity:1;transition:opacity .5s;"); |
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 scrollbarSize = (function() { | |
var inner = document.createElement( "div" ), | |
outer = document.createElement( "div" ); | |
inner.style.width = "100%"; | |
inner.style.height = "60px"; | |
outer.style.position = "absolute"; | |
outer.style.top = "0"; | |
outer.style.left = "0"; | |
outer.style.visibility = "hidden"; | |
outer.style.width = "50px"; |
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() { | |
'use strict'; | |
document.addEventListener('keydown', function(event) { | |
var S = 83, | |
activeElement = document.activeElement, | |
saveButtonId, | |
saveButton; | |
if ((event.key === S || event.keyCode === S) && (event.metaKey || event.ctrlKey) && activeElement.nodeName === 'TEXTAREA') { |
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
# For more information about the properties used in | |
# this file, please see the EditorConfig documentation: | |
# http://editorconfig.org/ | |
root = true | |
[*] | |
charset = utf-8 | |
end_of_line = lf | |
indent_size = 2 |