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
| module SomeCommands; def add(x, y) x + y end; end; import SomeCommands; | |
| add 1, 1 # => 2 | |
| String.add 1, 1 # => 2 # ... with some solutions | |
| "hello".add 1, 1 # => # ... with others | |
| "hello".add 1, 1 # NoMethodError # is what I want | |
| "hello".instance_eval "add(1, 1)" # NoMethodError # as well |
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
| // Microbenchmark of Resig's compress() function versus more modern equivalents | |
| // Because I had nothing better to do apparently | |
| // | |
| // https://news.ycombinator.com/item?id=24615882 | |
| // | |
| // Results on my system (Core i7 7700, Node.js v10.15.3, Windows 10 2004) | |
| // Remember: Microbenchmarks are not indicative of actual performance in the | |
| // wild | |
| // | |
| // Comparing 7 implementations, 1000000 repetitions each |