This file contains 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/sh | |
set -e | |
errors=$(/usr/local/php7/sbin/php-fpm --fpm-config /usr/local/php7/etc/php-fpm.conf -t 2>&1 | grep "\[ERROR\]" || true); | |
if [ -n "$errors" ]; then | |
echo "Please fix your configuration file…" | |
echo $errors | |
exit 1 | |
fi | |
exit 0 |
This file contains 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
Try to create a "Person" model,that we can use the “children” method below. | |
>> tom = Person.create(name: “Tom”) | |
>> may = Person.create(name: “May”, parent: tom) | |
>> syd = Person.create(name: “Syd”, parent: tom) | |
>> tom.children.map(&:name) | |
=> [“Syd”, “May”] | |
Furthermore,can you design "grandchildren" method that we can use it like this? | |
>> wen = Person.create(name: “Wen”, parent: syd) | |
>> jon = Person.create(name: “Jon”, parent: may) | |
>> tom.grandchildren.map(&:name) |
This file contains 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 colemanLiau(counts) { | |
var LETTER_WEIGHT = 0.0588; | |
var SENTENCE_WEIGHT = 0.296; | |
var BASE = 15.8; | |
var PERCENTAGE = 100; | |
if (!counts || !counts.sentence || !counts.word || !counts.letter) { | |
return NaN; | |
} |