How to use the production environment files in VueJS
When you run the production build for your VueJS app, if a .env.production
file exists VueJS will use that one, even if another .env
file is present.
When you run the production build for your VueJS app, if a .env.production
file exists VueJS will use that one, even if another .env
file is present.
At some point you might end up with a challenge like this. You've got several items (we'll take an example of 3) laid out with flexbox.
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
The items have fixed width and they all fit on one row, but you want the third to jump on the second row.
Like this:
====item====item====
========item========
So how do you make them stack 2 on the first row, and the third on the second row, centered to the middle?
If you try flex-wrap: wrap, depending on the device resolution, it might do the trick or not. If all 3 fit on the same row, they won't wrap.
The solution is to force them by adding a collapsed row (height 0) which takes up the entire width of the container, making it occupy an entire row, thus pushing the 3rd item on the next row. Think of it like a <br>
tag.
<div class="container">
<div class="item"></div>
<div class="item"></div>
<div class="break"></div>
<div class="item"></div>
</div>
.break {
flex-basis: 100%;
height: 0;
}
Neat trick, right?
And it can be adapted to other situations as well, not necessarily flexbox.
Model::with([
"relationship" => function ($query) {
return $query->withoutGlobalScope(MyScope::class);
},
]);
Exif headers provide useful metadata when it comes to images such as the image's orientation.
If you have used / are using Intervention Image, you might have noticed that some of the pictures you upload are turned from portrait to landscape.
If you upload the image normally, in Laravel you can orientate the image properly like so:
Image::make(Request::file('image'))->orientate();
But if you get the image data as a base 64 string this approach won't work, but the following snippet can be used to get the desired information from the image
$stream_resource = "data://image/jpeg;base64," . $base_64_image_string;
$exif_meta = exif_read_data($stream_resource);
You can now get the image's orientation and act based on it's value
$orientation = $exif_meta["Orientation"];
Also, make sure you have this line in you php.ini file
allow_url_fopen=On
Otherwise you will get
ErrorException: exif_read_data(): Unable to open file in file [filename]
The simplest approach if you're not using a specilized IDE is to use the command line and sdkmanager as follows:
sdkmanager "platform-tools" "platforms;android-29"
Non-removable MDM profiles cannot officially removed without doing a full system wipe. This is a problem when you restore a system from Time Machine after you enrolled it into the MDM, as the MDM will break, leaving you unable to re-enroll the machine.
csrutil disable
. This will disable SIP (System Integrity Protection).cd /var/db/ConfigurationProfiles
rm -rf *
mkdir Settings
touch Settings/.profilesAreInstalled
csrutil enable
. This will re-enable SIP.The profile will be now removed and you will be able to re-enroll the Mac to your MDM.
Restoring from a Time Machine backup can create duplicate MDM VPN profiles.
If the Button isn’t available,you have to use a terminal command to remove it. Open the integrated Terminal and type
networksetup -removenetworkservice "duplicateVPNProfile"
// www.codewars.com/kata/525f3eda17c7cd9f9e000b39
const curry = (operand, operator) => (!operator) ? operand : operator(operand);
const [zero, one, two, three, four, five, six, seven, eight, nine] =
[0,1,2,3,4,5,6,7,8,9].map(operand => ((operator) => curry(operand, operator)));
const plus = (first) => (second) => second + first;
const minus = (first) => (second) => second - first;
const times = (first) => (second) => second * first;
const dividedBy = (first) => (second) => Math.floor(second / first);
target: 'static'
in your nuxt.config.js
generate: { fallback: '404.html' }
location /.
{
# Remove trailing slash and redirect it
rewrite ^(.+)/+$ $1 permanent;
# Redirect index.html
rewrite ^(.+)/index.html$ $1 permanent;
# Serve folder path via index.html
try_files $uri $uri/index.html =404;
# Serve a custom static error page
error_page 404 /404.html;
}
Midnight Commander opens up a new subshell at start which you can access with CTRL+O. Thing is this subshell will on certain shells like zsh make mc
sluggish or freeze. A quick fix is to disable that subshell if you don't use it that often.
Just add this to your .zshrc
file
alias mc="mc --nosubshell"
This will greatly improve mc's speed.