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
| #!/bin/bash | |
| # paste this in a sh file, set to executable, run | |
| # delete application.json as it saves your last session's opened windows | |
| rm -f ~/.atom/storage/application.json | |
| # start atom | |
| /usr/bin/atom & | |
| exit 0 |
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
| def quantize(val, to_values): | |
| """Quantize a value with regards to a set of allowed values. | |
| Examples: | |
| quantize(49.513, [0, 45, 90]) -> 45 | |
| quantize(43, [0, 10, 20, 30]) -> 30 | |
| Note: function doesn't assume to_values to be sorted and | |
| iterates over all values (i.e. is rather slow). | |