My (@pongstr) opinion about shorthand coding techniques
Shorthand code is not really a replacement for normal coding but it is very handy and useful in some cases. There are tons of opinions and debates around this but, again it all comes down what is necessary for your codebase and using it responsibly.
Enter this in the search box along with your search terms:
Get all gists from the user santisbon.
user:santisbon
Find all gists with a .yml extension.
extension:yml
Find all gists with HTML files.
language:html
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
-- To load this library, see section titled "-- Using a handler in a .scpt library" at the top of One_Liners.scpt. | |
on testJerryLib() | |
return 0 | |
end testJerryLib | |
(* The bad thing about this handler is that it always asks the user for admin credentials whether or not they are actually needed to answer the question on the given path. | |
Obviously, you can remove the 'with adminstrator privileges'. Unfortunately, this will cause the method to return 'false' if an existing path cannot be probed because of bad permissions. I can't see any way to differentiate between inadequate permissions and nonexisting file because they both set errNumber = 54. | |
The -e checks for directories or files. To require that the given path be a directory, use -d. For file, use -f. For more variations, see: | |
http://www.cyberciti.biz/tips/find-out-if-file-exists-with-conditional-expressions.html *) |
The main parts of our element are:
- The opening tag: This consists of the name of the element (in this case, p), wrapped in opening and closing angle brackets. This states where the element begins, or starts to take effect — in this case where the start of the paragraph is.
- The closing tag: This is the same as the opening tag, except that it includes a forward slash before the element name. This states where the element ends — in this case where the end of the paragraph is. Failing to include a closing tag is a common beginner error, and can lead to strange results.
- The content: This is the content of the element, which in this case is just text.
- The attribute: Contains the extra information about the element which you don't want to appear in the actual content (optional).
- The HTML element: The opening tag, plus the closing tag, plus the content, plus attributes (optional), equals the element.
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
// | |
// CSS value names | |
// | |
inherit | |
initial | |
unset | |
revert | |
// | |
// CSS_PROP_OUTLINE_STYLE |
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
# Resources to be used as redirect destinations. | |
# | |
# - Each distinct resource entry is separated by an empty line. | |
# - The first line in a resource entry is: token mime-type[;encoding] | |
# - All following lines are the data. An empty line signals the end of the | |
# data. | |
# | |
# If the encoding is absent, the data will be converted to base64, and the | |
# encoding will be set to `;base64`. |
made with esnextbin
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
// ==UserScript== | |
// @name No New Tabs | |
// @match * | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
document.querySelectorAll('a[target]').forEach((link) => { | |
link.setAttribute('target', '_self'); | |
link.setAttribute('rel', 'noopener noreferrer'); |
NewerOlder