I was thinking about what Brad Jones had said, so I was thought it might be fun to post what you learned today if anything.

Today I learned iPad pro overlaps desktop styles in css :rolleyes:

Will edit in a solution later..

Today I learned how to convert a datetime object from any timezone to UTC.

$ts = new DateTime($timestamp); // $timestamp is a date-time string
$ts->setTimezone(new DateTimeZone('UTC'));

Today I learned that [man]intval[/man] doesn't use the same integer parsing rules as PHP itself when the given base is 0.

$i = 0b1100;
$s = '0b1100';

echo $i, " ", intval($s, 0);
Weedpacket;11059679 wrote:

Today I learned that [man]intval[/man] doesn't use the same integer parsing rules as PHP itself when the given base is 0.

$i = 0b1100;
$s = '0b1100';

echo $i, " ", intval($s, 0);

I guess the casting stops as soon as it finds something in the string that is "not a number" in a character sense.

[~]$ php -a
Interactive shell

php > $i = 0b1100;
php > $s = '0b1100';
php >
php > echo $i, "  ", intval($s, 0);
12  0
php > $i = 1.3e3;
php > $s = '1.3e3';
php >
php > echo $i, "  ", intval($s, 0);
1300  1
php >

    Except

    $i = 0x1100;
    $s = '0x1100';
    
    echo $i, " ", intval($s, 0);  

      This "seems" to work

      @media only screen and (min-width: 769px) and (max-width: 1281px) { 
        body{
      	  background-color:pink;
        }
      }
      
      
      @media only screen  and (min-width : 1224px) {
      body{
      	  background-color:red;
        }
      
      }

      From what I noticed it will allow you to target iPad pro while ignoring desktop styles, css sure is user friendly :rolleyes:

        Weedpacket;11059683 wrote:

        Except

        $i = 0x1100;
        $s = '0x1100';
        
        echo $i, " ", intval($s, 0);  

          A new term...honeypot

          <input id="real_email" type="text" name="real_email" size="25" value="" />
          <input id="test_email" type="text" name="email" size="25" value="" />
          
          #test_email {
          display: none;
          }

            That you can type most any "time string" into the reminder window in Outlook. I have a reminder set to check email once an hour (so I don't do it more frequently on the one hand, or never on the other). Now, if it's, say, 9:02 when I actually do get around to looking at it, but I still want it to remind me again at 10 AM, I type "58 minutes" into the field. Until this week I was leaving it on the second screen until 9:15, then pulling "15 minutes" from the dropdown, and then pulling "30 minutes" from the dropdown at 9:30, etc.

            #yes_I_am_stupid_most_days
            #its_the_little_things

              Using your face (mainly the forehead) to cushion the impact when you collide with a racquetball court wall is a bad idea.

              NogDog;11059733 wrote:

              Using your face (mainly the forehead) to cushion the impact when you collide with a racquetball court wall is a bad idea.

              Ouch!

              TIL --- NogDog used to play racquetball.

                function screenWidth()
                	{
                		var width = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;
                
                	console.log(width);
                
                
                }
                
                window.addEventListener("resize", screenWidth);

                Everyday is a learning day :p

                Also racquetball is a spot, I'm almost sure of it :p

                  	var links = document.getElementsByClassName("my class name").getElementsByTagName('a');

                  Won't work as it is not a single item

                  	var links = document.getElementsByClassName("my class name")[0].getElementsByTagName('a');
                  
                  

                  Will work [0] makes the difference between getting the error message getElementsByTagName is not a function and not getting

                    cluelessPHP;11059791 wrote:
                    	var links = document.getElementsByClassName("my class name").getElementsByTagName('a');

                    Won't work as it is not a single item

                    	var links = document.getElementsByClassName("my class name")[0].getElementsByTagName('a');
                    
                    

                    Will work [0] makes the difference between getting the error message getElementsByTagName is not a function and not getting

                    Because you've queried for 3 different classes, "my", "class", and "name" (You've probably already figured this out?)

                    TIL that there are still good salespeople who speak excellent American English and aren't afraid to call you. Ooh, and also you shouldn't let your wife browse Amazon on your machine while you're logged in. Marshmallow cereal? Thumb-sucking books? Crema Gianduja alle Nocciole?

                      dalecosp;11059819 wrote:

                      Because you've queried for 3 different classes, "my", "class", and "name" (You've probably already figured this out?)

                      Oh that was just a place holder, I used

                      [code=php]
                      		var links = document.getElementsByClassName("deskTopcontrols")[0].getElementsByTagName('a');

                      [/code]
                      Maybe that's wrong then?

                      dalecosp;11059819 wrote:

                      Ooh, and also you shouldn't let your wife browse Amazon on your machine while you're logged in. Marshmallow cereal? Thumb-sucking books? Crema Gianduja alle Nocciole?

                      Noted for when I find one :p

                      dalecosp;11059819 wrote:

                      TIL that there are still good salespeople who speak excellent American English and aren't afraid to call you.

                      Goold ol USA and Wales, both countries always make me feel better about my awful spelling and grammar 😃

                        var links = document.getElementsByClassName("deskTopcontrols")[0].getElementsByTagName('a');

                        [FONT=Courier New]document.getElementsByClassName("deskTopcontrols")[/FONT] will get you an array of all elements that have that class. Since an array does not have a [FONT=Courier New]getElementsByTagName()[/FONT] method, you got it to "work" by calling it from the first element in the array (via the 0 index). That means -- I'm pretty sure -- that its result will only include elements that are within that first element of that array; so I'm guessing it's not doing what you really want -- unless you only expect there to be one element with that first class name?

                          NogDog;11059827 wrote:
                          var links = document.getElementsByClassName("deskTopcontrols")[0].getElementsByTagName('a');

                          [FONT=Courier New]document.getElementsByClassName("deskTopcontrols")[/FONT] will get you an array of all elements that have that class. Since an array does not have a [FONT=Courier New]getElementsByTagName()[/FONT] method, you got it to "work" by calling it from the first element in the array (via the 0 index). That means -- I'm pretty sure -- that its result will only include elements that are within that first element of that array; so I'm guessing it's not doing what you really want -- unless you only expect there to be one element with that first class name?

                          I think you're right, was working on something there and hm now I'm sure it's wrong, I'll put in clientside forum

                            var links = [], 
                                elements = document.getElementsByClassName("deskTopcontrols");
                            
                            for (var i = 0; i < elements.length; i++) {
                               links = links.concat(elements[i].getElementsByTagName('a'));
                            }
                            
                            // links is now an array of all a tags that are children to deskTopcontrols
                            

                            TIL that I hate irresponsible dog owners, who let their dog attack mine! (ok actually YESTERDAY I learned that)