There once was a Dev from East Mass.,
who wished to ensure his code could be passed.
Feeling most license types,
weren't worth all the hype
Wrote his own as an iconoclast.
His peers thought him a narcissist,
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
| # Caesar cipher encoding | |
| echo "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" | tr '[A-Z]' '[X-ZA-W]' | |
| # output: QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD | |
| # Caesar cipher decoding | |
| echo "QEB NRFZH YOLTK CLU GRJMP LSBO QEB IXWV ALD" | tr '[X-ZA-W]' '[A-Z]' | |
| # output: THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG | |
| # Can also be adjusted to ROT13 instead |
It assumes the highest positive signed 32-bit float value for numbers.
In other words, 2147483647 (or 0x7FFFFFFF or 2^31-1).
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
| // cardInfo() | |
| // | |
| // Determines if a credit card number is valid and returns the name of the issuing network. When | |
| // passed a purported card number as a candidate if the card number is valid, the cardInfo() | |
| // function returns a boolean flag ('isValid') indicating if the card is a valid number and a | |
| // string ('network') containing the name of the issuing network. Card validity is determined | |
| // based upon the card number length and Luhn check digit value. Valid card lengths are based | |
| // upon the card lengths valid for a given issuing network. The Luhn check digit is calculated | |
| // using the Luhn algorithm. The function contains a static table ('IINData') that defines the | |
| // supported issuing network. The table is not a complete list--it is only meant to contain |
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
| import sublime | |
| import sublime_plugin | |
| import re | |
| class CompactExpandCssCommand(sublime_plugin.TextCommand): | |
| def run(self, edit, action='compact'): | |
| rule_starts = self.view.find_all('\{') | |
| rule_ends = self.view.find_all('\}') |