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
| const chain = (...fns) => initialValue => | |
| fns.reduce((previousOutput, fn) => fn(previousOutput), initialValue); | |
| chain(x => x + 1, x => x / 2)(0).should.equal(0.5); | |
| chain(x => x / 2, x => x + 1)(0).should.equal(1); | |
| // run it: https://jsfiddle.net/s8hwae47/ |
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
| const chai = require('chai'); | |
| chai.should(); | |
| const listMonad = { | |
| // make :: a -> m a | |
| // make :: a -> [a] | |
| make: (...args) => args, | |
| // bind :: m a -> (a -> m b) -> m b | |
| // bind :: [a] -> (a -> [b]) -> [b] | |
| bind: someList => listReturningFunction => |
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
| browser.addCommand('waitForBrowserSide', function waitForBrowserSide (callback) { | |
| return browser | |
| .timeoutsAsyncScript(10000) | |
| .executeAsync(function thisRunsInsideTheBrowser(callback, done) { | |
| setInterval(function () { | |
| if (callback()) { | |
| done(); | |
| } | |
| }, 100); | |
| }, callback) |
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
| { | |
| "env": { | |
| "es6": true, | |
| "node": true | |
| }, | |
| "ecmaFeatures": { | |
| "jsx": true, | |
| "modules": true | |
| }, | |
| "plugins": [ |
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
| curl -s https://api.github.com/orgs/PrestaShop/repos | ruby -rjson -e 'JSON.load(STDIN.read).each {|repo| %x[git clone #{repo["ssh_url"]} --recursive]}' |
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
| function getStatusAndLocation($url) | |
| { | |
| $ch = curl_init($url); | |
| curl_setopt($ch, CURLOPT_NOBODY, true); | |
| curl_setopt($ch, CURLOPT_HEADER, true); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER , true); | |
| $headers = curl_exec($ch); | |
| $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); | |
| curl_close($ch); |
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 | |
| echo "SHOW DATABASES LIKE '%tmpshpcpy%'" | mysql -h127.0.0.1 -P3307 -uroot | \ | |
| sed -n '1!p' | xargs -I{} mysql -h127.0.0.1 -P3307 -uroot -e "DROP DATABASE {}" | |
| sudo rm -Rf /www/*tmpshpcpy* |
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
| $('td.uploaded-file-name').each(function (i, td) { | |
| var $td = $(td); | |
| var $crowdinFileSelect = $td.closest('tr').find('td.source-file select'); | |
| var filename = $td.text(); | |
| var m; | |
| function select(title) { | |
| var option = $($crowdinFileSelect.find('[title="' + title + '"]')).val(); | |
| $crowdinFileSelect.val(option); | |
| } |
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
| <?php | |
| /** | |
| * This will display the first 10 numbers of the Fibonacci sequence. | |
| * Really. | |
| */ | |
| declare(ticks=1); | |
| $a = 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
| #cloud-config | |
| hostname: prestacoreos | |
| ssh_authorized_keys: | |
| - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMPxhavnLUdZd7wafQGBhbNqBAW1xfOBDCmLJ65t8FO3t4q39yAQmcEIM6fyhcgnYUl1iCpU/1Wm2JPwjHwFd0du7XDCuJaBDvoNC/oSv5rGcXdKLa5BXJo59k8s6/xYmpz6l6o0Kf5P+nfdhyrBvCbHUZxpX9iQPuEIRpH/s+k4/K815p+wsV+z7z7RSbAJLTxsrtQRpwu/3PvG+2HQZ9AXqjUwXI07LhwUkPSfRQOTeQEzOpeqnx+YSCtrnRlnEegKUKEyewU5bHfAuRQ1AA8VMdekaCeb5LNzCDQxv+Z+utzaY6pW/huHfkBTsOjwnKWIpnb48PC4D7icw7vS7l | |
| users: | |
| - name: djfm | |
| coreos-ssh-import-github: djfm | |
| groups: | |
| - sudo |