The JSON data is in the following format
{
"Genesis": {
"1": {
"1": "In the beginning..." ,
"2": "..."
| <?hh | |
| // Based on https://gist.github.com/chregu/9740519 | |
| class Fetcher { | |
| // async function: http://docs.hhvm.com/manual/en/hack.async.php | |
| // return type annotation: http://docs.hhvm.com/manual/en/hack.annotations.introexample.php | |
| // generics: http://docs.hhvm.com/manual/en/hack.generics.php | |
| public async function fetch(string $url) : Awaitable<array> | |
| { |
| <?hh | |
| class Fetcher { | |
| // async function: http://docs.hhvm.com/manual/en/hack.async.php | |
| // return type annotation: http://docs.hhvm.com/manual/en/hack.annotations.introexample.php | |
| // generics: http://docs.hhvm.com/manual/en/hack.generics.php | |
| public async function fetch(string $url) : Awaitable<int> { | |
| $ch1 = curl_init(); | |
| print "get $url \n"; |
| $logger = new Logger('test logger'); | |
| $memoryStream = fopen('php://memory', 'w'); | |
| $memoryHandler = new StreamHandler($memoryStream); | |
| $logger->pushHandler($memoryHandler); | |
| // your code | |
| rewind($memoryStream); | |
| $logs = stream_get_contents($memoryStream); |
| -- show running queries (pre 9.2) | |
| SELECT procpid, age(clock_timestamp(), query_start), usename, current_query | |
| FROM pg_stat_activity | |
| WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
| ORDER BY query_start desc; | |
| -- show running queries (9.2) | |
| SELECT pid, age(clock_timestamp(), query_start), usename, query | |
| FROM pg_stat_activity | |
| WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
| [user] | |
| name = Pavan Kumar Sunkara | |
| email = [email protected] | |
| [core] | |
| editor = vim | |
| whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| [sendemail] | |
| smtpencryption = tls | |
| smtpserver = smtp.gmail.com | |
| smtpuser = [email protected] |
| require 'rubygems' | |
| require 'yaml' | |
| # A demonstration of YAML anchors, references and handling of nested values | |
| # For more info, see: | |
| # http://atechie.net/2009/07/merging-hashes-in-yaml-conf-files/ | |
| stooges = YAML::load( File.read('stooges.yml') ) | |
| # => { | |
| # "default" => { |