Quantcast
Channel: User Jacob - Stack Overflow
Browsing latest articles
Browse All 45 View Live

Comment by Jacob on Javascript / Chrome - How to copy an object from the...

JSON.stringify() can't handle circular references: Uncaught TypeError: Converting circular structure to JSON

View Article



Comment by Jacob on Is there a way to disable code coverage in PHPUnit for a...

@AlexHowansky Thanks, just making a note for future readers... including myself :)

View Article

Comment by Jacob on Make PhpStorm stop automatically closing tabs

What an absolutely useless "feature". They make some bizarre design decisions about their IDEs, which wouldn't be too bad if they gave us the option to disable them.

View Article

Comment by Jacob on How to mock File in javascript?

Note: IE11 doesn't allow passing undefined as second argument to Blob constructor. Either pass an object or don't specify the argument.

View Article

Comment by Jacob on Get the first element of an array

What if the array is empty? reset() will return false, which may lead to bugs if you expect the array to contain bool values.

View Article


Comment by Jacob on Get the first element of an array

What if the array is empty? reset() will return false, which may lead to bugs if you expect the array to contain bool values.

View Article

Comment by Jacob on Get the first element of an array

What if the array is empty? reset() and current() will return false, which may lead to bugs if you expect the array to contain bool values.

View Article

Comment by Jacob on Get the first element of an array

What if the array is empty? reset() will return false, which may lead to bugs if you expect the array to contain bool values.

View Article


Comment by Jacob on PhpStorm type-hinting for factories?

@ahnbizcad It's powerful for non-trivial methods. Also, the file doesn't need to reside in your repo. I put mine in a different directory and added the directory to my project.

View Article


Comment by Jacob on PHPDoc and late (static or dynamic) binding

@mvriel Update link: docs.phpdoc.org/3.0/guide/guides/types.html#pseudo-types

View Article

Comment by Jacob on Null-safe property access (and conditional assignment) in...

@Mulan I'm stuck with legacy code that has deeply nested properties, so this would be very useful. I'd love to refactor it to not suck so much, but sadly, can't.

View Article

Comment by Jacob on A form doesn't submit

Make mysqli throw exceptions by default

View Article

Comment by Jacob on A form doesn't submit

Make mysqli throw exceptions by default

View Article


Comment by Jacob on Looping through all the properties of object php

You already have the value so just do echo "$key => $value\n";

View Article

Comment by Jacob on Should I use px or rem value units in my CSS?

It's a lot easier to change the default font size since most (all?) browsers now allow searching for settings. So in Chrome I can go to settings, search "font", and the font settings appear. I tried...

View Article


Answer by Jacob for CSS - Horizontally and vertically distribute divs

Flexbox to the rescue!Good resources:https://philipwalton.github.io/solved-by-flexbox/https://github.com/philipwalton/flexbugs#container { display: flex; /* magic maker */ justify-content:...

View Article

Answer by Jacob for how to display same image multiple times using same image...

Make a function that generates a new image and call it when needed. The image is loaded once the first time it is inserted to the DOM. The browser caches it so it won't be downloaded on subsequent...

View Article


Answer by Jacob for Responsive square depending on content width

.wrapper-outer { display: inline-block; /* make as wide as text */ vertical-align: top; background-color: green;}.wrapper-outer:nth-child(2) { background-color: tomato;}.wrapper-outer:nth-child(3) {...

View Article

Answer by Jacob for Have text-div aligned right bottom on top of image

Make the image the same width as the wrapper, #header-img in your example, then use the wrapper to position the text.#header-img { position : relative; min-width : 100%; min-height : 50%;}#topimg {...

View Article

Answer by Jacob for CSS Transition not working on nested items

Use jQuery's mouseenter and mouseleave events rather than mouseover and mouseout.mouseover and mouseout fire every time you hover from one element to another within .menu_container. Therefore, when you...

View Article

Answer by Jacob for Giving focus after a href

Use a label styled like an a. Make sure the label's for attribute matches the input's id attribute. This will focus the input when the label is clicked and scroll the page so the input is in...

View Article


Answer by Jacob for Trigger css hover in javascript

You can use jQuery's hover method and toggle the hover class on your container.$('.flip-container').hover(function() {$(this).toggleClass('hover');});.flip-container {position: absolute;perspective:...

View Article


Answer by Jacob for CSS 3D Carousel Elements Don't Respect TranslateZ

perspective-3d isn't a valid value for transform-style; it should be preserve-3d, and this should go on the container, in your case .carouselNumber.prototype.mod = function(n) { return...

View Article

Answer by Jacob for How to make an element's position absolute in page,...

You can sort of work around this limitation. If you know the absolutely positioned parent's computed position values you can use those combined with calc() to determine the child's required positioning...

View Article

Answer by Jacob for Horizontally Align Position Fixed Div

Add the following to your CSS:div#countdown { left: 50%; /* move #countdown's left edge to center */ transform: translateX(-50%); /* shift #countdown to the left by half of it's width */ white-space:...

View Article


Answer by Jacob for MEME-Generator (jQuery and CSS Help)

Put the image and text in #meme, collapse that with display: inline-block (you could also use float or other methods depending on situation). The text won't expand greater than the width of #meme which...

View Article

Answer by Jacob for responsive map not showing under 550px

The problem is the huge margin-left on .right causes it to shrink.Use a media query to only use the float layout above a certain viewport width. I added one to your CSS. You can adjust the min-width...

View Article

Answer by Jacob for How to keep indent for second line in ordered lists via CSS?

I had this same issue and started using user123444555621's answer. However, I also needed to add padding and a border to each li, which that solution doesn't allow because each li is a table-row....

View Article

Answer by Jacob for How do you set a text's, that is overlaid over an image,...

There a number of ways to do this. Assuming your text follows your img element, you can use the hover pseudo-class and adjacent sibling selector to target the text and apply your CSS.div { position:...

View Article



Answer by Jacob for Style block element where each line has vertical gap and,...

If you know the background-color of the page, you can use a few tricks.First, apply a background-image: repeating-linear-gradient(); on each heading. This will provide the "spacing" in between each...

View Article

Answer by Jacob for HTML CSS - sticky footer

The .push element needs to go in the .wrapper element.* {margin: 0;}html, body {height: 100%;}.wrapper {min-height: 100%;height: auto !important;height: 100%;margin: 0 auto -40px;}.footer, .push...

View Article

Answer by Jacob for display: none on body tag in chrome does not hide background

Per the W3 CSS2 spec, For HTML documents, however, we recommend that authors specify the background for the BODY element rather than the HTML element. User agents should observe the following...

View Article

Answer by Jacob for Hide Blog Post Author on Wordpress Theme (The Fox)

You can use the following CSS:This hides the author..post .post-info a[rel="author"] { display: none;}This shifts the remaining text to the left and hides the "By | "..post .post-info { overflow:...

View Article


Answer by Jacob for Align CSS content

Update your CSS to this.c100 { position: relative; font-size: 120px; width: 1em; height: 1em; border-radius: 50%; /* float: left; */ margin: 0 auto 0.1em auto; /* margin: 0 0.1em 0.1em 0; */...

View Article

Answer by Jacob for Vertically align element inside of a floating div with no...

Just make .about_container .welcome a flex container too. Add this to the .about_container .welcome rule:display: flex;flex-direction: column;justify-content: center;

View Article

Answer by Jacob for Performing calculations (calc) on data attributes in CSS...

Here's a simple JavaScript solution:var pids = document.querySelectorAll('[data-pid]');Array.prototype.forEach.call(pids, function(elem, index) { elem.classList.add('pid-mod-'+ (index %...

View Article


Answer by Jacob for Image causing table cell height to extend

Remove height from .outer-icon. I don't know that it's ever a good idea to apply height to a table cell. Set vertical-align: middle; on .search-bar and .outer-icon.

View Article


Answer by Jacob for create a table with thead wider than the table itself

You can use the caption element, which spans the table's width and is more semantically correct in your situation since it describes the entire table. Then use a pseudo-element to fill the remaining...

View Article

Answer by Jacob for thumbnail images aren't aligned right

You're hiding some thumbnails using <div class="hidden"></div>. Some of those div's children have the item-thumbs class which your main.js script is taking into account when setting up...

View Article

Answer by Jacob for HTML anchor in URL is not working in Chrome

You have two elements with the same id="corporate-innovation". The browser is going to the first of those elements. id's must be unique to one element. Check the spec.

View Article

Answer by Jacob for Convert JSON array in MySQL to rows

If you can't use the JSON_TABLE function, but can use recursive CTE's, you can do the following:SET @j = '[1, 2, 3]';WITH RECURSIVE x AS ( /* Anchor, start at -1 in case empty array */ SELECT -1 AS n...

View Article


Why does PHP strict typing allow function arguments of wrong type?

I'm using PHP 7.4.16. I enabled strict_types in my PHP file thinking it would prevent passing a string argument to a function expecting an int by throwing a TypeError. However, the function actually...

View Article

Answer by Jacob for Why would $_FILES be empty when uploading files to PHP?

If you're using AJAX instead of a Form submission, then ensure the request header Content-Type is set to multipart/form-data; boundary=myAwesomeBoundary' where myAwesomeBoundary is the unique string...

View Article


Image may be NSFW.
Clik here to view.

Failed to set up deployment source for web app, using Visual Studio Team...

I have already set up a deployment from master branch of Git repository mywebapp in Visual Studio Team Services to a web app in Azure. I did this through Azure Portal's "Deployment source" setting for...

View Article

Answer by Jacob for How set width and height attributes for element within...

Allowing width and height attributes on <source> elements is now in the spec and browsers are beginning to adopt it.GitHub Issue

View Article

Browsing latest articles
Browse All 45 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>