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: (function () { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ return clipboardData.setData( | |
"Text", | |
text | |
); | |
} else if ( | |
document.queryCommandSupported && | |
document.queryCommandSupported("copy") |
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
{ | |
"vim.normalModeKeyBindings": [], | |
"vim.visualModeKeyBindings": [ | |
{ | |
"before": [ | |
">" | |
], | |
"commands": [ | |
"editor.action.indentLines" | |
] |
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: (function () { | |
function copyToClipboard(text) { | |
if (window.clipboardData && window.clipboardData.setData) { | |
/*IE specific code path to prevent textarea being shown while dialog is visible.*/ | |
return clipboardData.setData('Text', text); | |
} else if (document.queryCommandSupported && document.queryCommandSupported('copy')) { | |
var textarea = document.createElement('textarea'); | |
textarea.textContent = text; | |
textarea.style.position = 'fixed'; | |
/* Prevent scrolling to bottom of page in MS Edge.*/ |
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
# source https://stackoverflow.com/questions/46037728/find-all-node-modules-directories | |
# https://rtmccormick.com/2018/01/10/clear-node-modules-folders-recursively-mac-linux/ | |
find . -name "node_modules" -prune -exec rm -rf '{}' + |
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
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
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
#!/bin/bash | |
# | |
# addlicense.sh - prepends a license notice to a set of files | |
# | |
# Originally written by Sam Hanes <[email protected]>. | |
# To the extent possible under law, the author has waived all copyright | |
# and related or neighboring rights in this work, which was originally | |
# published in the United States. Attribution is appreciated but not | |
# required. The complete legal text of the release is available at | |
# http://creativecommons.org/publicdomain/zero/1.0/ |
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> | |
<meta charset="UTF-8"> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 20px; } | |
@media (min-width: 768px){ | |
body{ padding-top: 150px; } | |
} | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } |
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
// source https://github.com/nmn/react-timeago/issues/85#issuecomment-306959939 | |
import React, { PureComponent } from 'react'; | |
import PropTypes from 'prop-types'; | |
import moment from 'moment'; | |
const makeRelative = (dateMoment) => { | |
if (!dateMoment.isValid()) { return ''; } | |
return dateMoment.fromNow(); | |
}; |
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
// source stackoverflow | |
const form = new window.FormData() | |
for (let pair of form.entries()) { | |
console.log(`${pair[0]}: ${pair[1]}`) | |
} |
NewerOlder