5 ms·
Jezen/is-thirteen: Check if a number is equal to 13
- labster 10y agoThank goodness they have a Code of Conduct for contributors. The people behind this project wouldn't want to put other people down.
- cmwelsh 10y agoThey are very proud of their Code of Conduct and Kindness (COCK).
- joshrotenberg 10y agoThey should be. It's small but effective, proving once again that size doesn't matter.
- TelAviv 10y agoCareful! You might discourage some young woman from learning about the number 13 with this sexual joke.
- daveloyall 10y ago177 commits.
- daveloyall 10y agoFavorite so far: "Remove imgur dependency"
- amelius 10y ago54 open issues
- jcadam 10y agoPfft.. So far they've all missed Octal support (015). Relax, everyone, I took care of it: https://github.com/jezen/is-thirteen/pull/259/ https://github.com/jezen/is-thirteen/pull/259/
- riebschlager 10y agoMy first reaction was, "Haha. That's fun code-as-parody." Then I looked at the unit tests. [1] Now my reaction is more like, "Your commitment to this bit is both admirable and slightly disturbing." [1] https://github.com/jezen/is-thirteen/blob/master/test.js https://github.com/jezen/is-thirteen/blob/master/test.js
- gkoberger 10y agoI think that's the point the parody is making. A simple "piece" of code can have thousands of edge cases that a normal developer doesn't think about. That's the advantage of the UNIX-style "everything does one thing and does it well" philosophy that Node mirrors.
- justinlardinois 10y agoYou could just as easily read it as a comment on overengineering.
- tluyben2 10y agoThat's what I did anyway...
- dhatch387 10y ago> tap.equal(is("B").thirteen(), true); // B looks like 13
- dTal 10y agoUnless it's hidden by obfuscation, judging by the source code I think that test actually fails, and hilariously only lowercase 'b' works.
- acrooks 10y agoNah, they do case insensitive matching: https://github.com/jezen/is-thirteen/blob/master/index.js#L115 https://github.com/jezen/is-thirteen/blob/master/index.js#L1...
- ominous 10y agoWe have reached peak npm.
- andrewstuart2 10y agoAnd for the Java/Enterprise equivalent: https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpris...
- leeoniya 10y agoand also http://projects.haykranen.nl/java/ http://projects.haykranen.nl/java/
- deleted 10y ago[deleted]
- geodel 10y agoI think FizzBuzz is far more complex problem than this isThirteen. This FizzbuzzEE solution shows where Java truly shines: powerful dependency management, industry leading design patterns. My only wish is to add parallel streams, lambda and other latest Java 8 feature support.
- slantedview 10y agoHoly hell, that is impressive.
- erichurkman 10y agoThis was a lot more effective before Github collapsed empty directories.
- ldom22 10y agoThis library is just what I need for my side project. Hopefully it will be taken up as a standard for other numeric comparisons.
- Nadya 10y agoSeems like a spin off of five.js https://github.com/jackdcrawford/five https://github.com/jackdcrawford/five
- 1QAm1 10y agoSo it seems, and by years.
- gizmo686 10y agoThis is a great example of why it is important to use modules. If I were to try implementing this myself, I might have thought to check for the Chinese string "十三", but I doubt I would have known to check for the uppercase version of the Chinese string "拾叄". More seriously, does anyone know what "uppercase" means in Chinese? Do they literally have two (seemingly unrelated) forms for each of their characters?
- xiaq 10y agoOnly numerals have upper cases to prevent tampering. For example, you can alter 一(one) to 十(ten) pretty easily, but not 壹 to 拾.
- PeCaN 10y agoOh, that actually makes a lot of sense. That also explains why they're used for checkwriting. Thanks!
- rememberlenny 10y agoThere is no uppercase character in Chinese. The Chinese characters are unicode strings. The answer would be the same about an uppercase emoji.
- PeCaN 10y agoChinese only has uppercase numbers (called 大写, lit. "big writing"). I̶ ̶d̶o̶n̶'̶t̶ ̶k̶n̶o̶w̶ ̶w̶h̶y̶,̶ ̶b̶u̶t̶ ̶I̶'̶m̶ ̶h̶a̶r̶d̶l̶y̶ ̶a̶n̶ ̶e̶x̶p̶e̶r̶t̶ ̶i̶n̶ ̶C̶h̶i̶n̶e̶s̶e̶.̶ ̶T̶h̶e̶y̶'̶r̶e̶ ̶n̶o̶t̶ ̶u̶s̶e̶d̶ ̶m̶u̶c̶h̶. EDIT: Nevermind me, see xiaq's much better comment.
- dfc 10y agoDoes anyone know why this breaks the content wrapping? I have seen <pre> classes do this but this text is just normal HN comment class. I really hope using strikeout unicode does not catch on around here. It is horrible.
- neeleshs 10y agotap.equal(is('Olivia Wilde').thirteen(), true); Fellow House fan!
- 1QAm1 10y agoCan't someone do this in about 4 characters of Perl?
- PeCaN 10y agoYes, but the "could be interpreted as" operator, colloquially "sleep equals" is pretty obscure and not recommended for production: "thirteen" ~_~ 13
- wund 10y agoDoes this work on IE7?
- barlo 10y agoThis native version has much better performance: https://github.com/taganaka/is-thirteen-native https://github.com/taganaka/is-thirteen-native
- gardnr 10y agocommit 512813f Added Klingon translation and and test for word "thirteen" https://github.com/jezen/is-thirteen/commit/512813f https://github.com/jezen/is-thirteen/commit/512813f
- rcthompson 10y agoHalf the issues suggest the use of actual NPM modules, and I'm at a loss to tell which ones are jokes. For example: "Replace noop3 with noop4 (also keep an eye out for noop5)" https://github.com/jezen/is-thirteen/issues/151 https://github.com/jezen/is-thirteen/issues/151
- minimaxir 10y agoFor more 13 fun, check of the Magic: the Gathering card Triskaidekaphobia. (Specifically, counts in the art and the rules text.) http://media.wizards.com/2016/aksdjciawolkcc0_soi/en_CMrxVczUb3.png http://media.wizards.com/2016/aksdjciawolkcc0_soi/en_CMrxVcz...
- Pxtl 10y agoIsn't MTG a 1v1 game generally? "Each player"?
- nexaddo 10y agoElder Dragon Highlander or Commander is a multiplayer format. http://mtgcommander.net/rules.php http://mtgcommander.net/rules.php
- drdeca 10y agoI think it depends on the format, so cards have to handle the case of many players. I think there are quite a number of many player formats actually. Like, in one, some number of packs a cracked, and they are passed around in a circle, each person picking one card, until everyone has a deck, and then they play. Iirc. (Haven't played it myself.)
- minimaxir 10y agoIt is "each player" since the card can backfire and cause you to lose the game, if your opponent is clever.
- nthcolumn 10y agounit test for morse code: thirtees?
- smegel 10y agoIf he's going to troll like this, shouldn't it have 13 obscure dependencies as well?
- dboreham 10y agoFew days too early? I think it would be better done with 11 though. "Check if this one goes to..."
- mchahn 10y agoI thought this was a parody on pad-left.
- deleted 10y ago[deleted]