Today i learned how to work from home and earn money through internet...!**

    14 days later

    This one surprised me. UNIX-y systems have cat(1), as many of us know:

    cat file.txt file2.txt > combined.txt

    I was surprised by this on Windows, though:

    copy *.csv combined.csv

    Did everyone else just know that and I'm only learning 20 years later? 😃

      I didn't know about that (or if I did I long forgot it); I use a port of cat on Windows.

      10 days later

      Today I learned

      $foo = 'hello world!';
      $foo = ucwords($foo);    
      echo $foo;
      22 days later

      Today I learned

      $a = [1, 2, 3];
      $b = [4, 5, 6];
      $c = [...$a, ...$b];
      
      var_dump($c);
      

      But that doesn't work if the arrays have string keys.

      Weedpacket

      Reminds me that yesterday I learned that in Ruby you can do:

      $ irb
      2.4.0 :001 > test = ['a', 'b', 'c', 'd']
       => ["a", "b", "c", "d"]
      2.4.0 :002 > test - ['c']
       => ["a", "b", "d"]
       
        2 months later

        Today I learnt e.preventDefault stops checkbox from being checked....why didn't I know that?

          TIL (okay, a couple days ago) that there is a json_agg() function in PostgreSQL.

          SELECT
            r.review_id,
            r.review_timestamp,
            json_agg(a.*) AS answers
          FROM $schema.review r
          INNER JOIN $schema.answer a ON a.review_id = r.review_id
          WHERE -- stuff
          GROUP BY review_id, review_timestamp

          Now I get just one row returned for each relevant review, and each row contains a JSON string with all the answers associated with that review. 🙂

            $schema.answer

            Not sure why my brain is expecting a ? or :schema.answer there

            cluelessPHP Not sure why my brain is expecting a ? or :schema.answer there

            We use Postgres's "schemas" to separate each client's data -- functionally similar to having them each in their own database, except they're not. 🙂 That query was actually extracted from the PHP code that builds the query (and simplified and anonymized here), so $schema would actually be replaced with the relevant schema name for the client being processed, e.g FROM client_foo.review r, and then processed with $pdo->prepare().

            cluelessPHP
            This saddened me a bit. Watched "You Only Live Twice" and "Thunderball" this weekend in his honor. Wish I had a copy of "Robin and Marian", the chemistry he had with Audrey Hepburn was amazing. And I might be a fan indeed as I don't even hate Zardoz TOO much.

            Finally, pretty good compilation of the early Bond themes: https://youtu.be/J4jdUhxOz0M

            dalecosp

            Zardoz is fun if not taken seriously. 🙂

            "The Man Who Would Be King" is pretty darned good. He and Michael Caine make a great pair in it.

            5 days later
            25 days later
            6 days later

            TIL that the film 'Lawrence of Arabia' had its world premiere 10 years closer to the start of the Great War than to the current day.

              9 days later

              sneakyimp you might not like what else ol' Zardoz has to say...

              You sound like my wife 😆

              Remember, at the end Connery comes to find out that part ain't true after all ... 😄