Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| # run "bc -l" and then... | |
| define fpow(a, b) { return e(b * l(a)); } | |
| # example (calculate monthly percent by year percent): pow(1.08, 1/12) | |
| # 1.00643403011000345482 |
| #/bin/bash | |
| find tracks -size 0c -delete |
| //see https://github.com/mfunkie/react-overlay | |
| import { Overlay } from 'react-overlay'; | |
| // or | |
| const { Overlay } = require('react-overlay'); | |
| // or | |
| var Overlay = require('react-overlay').Overlay; |
| hg log -G -l 10 --template "{rev} [{phase}] {date|isodate}, {author|person}, {node}\n {desc}\n\n" | |
| #210 [public] 2016-04-23 02:41 +0300, d9k, 117988d537c4bfc178e44ef562a41944c1bdb942 | |
| # one click buy form: payment system field |
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| scramble = lambda word: [''.join(x) for c in range(len(word)) for x in itertools.combinations(word,c)] | |
| # example: | |
| # >>> scramble('sample') | |
| # ['', 's', 'a', 'm', 'p', 'l', 'e', 'sa', 'sm', 'sp', 'sl', 'se', 'am', 'ap', 'al', 'ae', 'mp', 'ml', 'me', 'pl', 'pe', 'le', 'sam', 'sap', 'sal', 'sae', 'smp', 'sml', 'sme', 'spl', 'spe', 'sle', 'amp', 'aml', 'ame', 'apl', 'ape', 'ale', 'mpl', 'mpe', 'mle', 'ple', 'samp', 'saml', 'same', 'sapl', 'sape', 'sale', 'smpl', 'smpe', 'smle', 'sple', 'ampl', 'ampe', 'amle', 'aple', 'mple', 'sampl', 'sampe', 'samle', 'saple', 'smple', 'ample'] | |
| # inspired by http://sahandsaba.com/thirty-python-language-features-and-tricks-you-may-not-know.html |
| #!env php | |
| <?php | |
| //script is intended to run from site directory | |
| //tested on Joomla 2.5 | |
| $currentDir = getcwd(); | |
| echo "Running from \"${currentDir}\"\n"; | |
| $configPath = $currentDir.'/configuration.php'; | |
| $backupFolderPath = $currentDir.'/.backupdb'; | |
| $backupPath = $backupFolderPath.'/backup.sql'; |
| ====================================================================== | |
| Survival Time: 4 days, 11.52 hours. | |
| 2016.12.25 06:27 | |
| Final Moments: | |
| Dogman Leader grazed Player's upper stomach with a claw. | |
| Dogman attacks Player...and hits! |
| #!/usr/bin/env lua | |
| -- needs luacoket module: | |
| -- `sudo luarocks install luasocket` | |
| exercises=[[ | |
| отжимания, 5 раз | |
| мостик, 8 секунд | |
| приседания, 5 раз | |
| пресс, 6 раз | |
| подтягивания, 2 раза |
Got to work with local node_modules installation.
npm install --save babel-cli babel-preset-es2015 babel-preset-react babel-preset-stage-0node_modules/.bin/babel --presets=es2015,stage-0,reactinput:
`let a = 5; console.log(a);