アプリ関連ニュース
- 2021年4月12日
- Mac
Unrar for macOS
Today I will talk about unrar for the people who are using macOS , can’t open rar file as default. For the zip file , we don’t need extra installable libraries or something as the system includes by default.
Recently, we can install unrar through brew like this.
brew install unrar
Unfortunately unrar has been removed from homebrew core because of licensing issues.
But don’t worry if you are looking for an alternatives, there is a library called carlocab/personal/unrar and you can install like this.
brew install carlocab/personal/unrar
After installation, we can call unrar in your terminal and it will look like this

and we can simply start using like this.
unrar x filename.rar
Actually, there are other formulae on homebrew-core that also extract various forms of compressed files. Depending on the formats you are working with, you may find that there is already an existing homebrew-core formula that suits your needs.
I will also add a link for your further reference here.
Thanks for reading.
Yuuma
yuuma at 2021年04月12日 11:00:11
- 2021年4月09日
- 技術情報
Prohibited Validation Rules in Laravel
Sometimes we wish to forcefully prevent some of the fields in the request.
Now we just got that. Laravel 8 has three validation added for prohibited fields. Let’s walk through a few examples of where the prohibited validation rules might be useful and look at each one in more detail.
Prohibited Validation Rule
The “prohibited” rule checks if the field under validation must be empty or not present or throw an error otherwise.
// PUT /api/licenses/123-456
// {"name":"hello-world", "key":"random-key"}
$validated = $request->validate([
'name' => 'required|max:255',
'key' => 'prohibited',
]);
// Response: 422
// The key field is prohibited
The above is where a user might expect to update an API key by sending a PUT request to a resource. That field is likely ignored during the request. However, a successful response might lead to the user to believe they were able to update the key when in reality, the API ignored it.
If prohibited validation rule registers, the key field is present in the request it will terminate the request with 422 HTTP code response code and throw the error with the message The key field is prohibited.
Prohibited If and Unless Rules
The “prohibited_if ” rule checks if the field under validation must be empty or not present if the another field is equal to any value.
Validator::validate([
‘is_minor’ => true,
‘tos_accepted’ => true
], [
‘tos_accepted’ => ‘prohibited_if:is_minor, true’
]);
The above example is we’re expecting tos_accepted field will be forbidden if is_minor filed accepts true value. This example means someone accepting terms of service that has identified as a minor. Perhaps the application requires a parental registration to consent on their behalf.
The basic idea of “Prohibited_unless” rule is that a given filed should be prohibited from having data unless another field is equal to any value.
Validator::validate([
‘is_deceased’ => false,
‘date_of_death’ => ‘2021-03-09’
], [
‘date_of_death’ => ‘prohibited_unless:is_deceased,true’
]);
The above example might be initially the is_deceased filed set to false value.If we’re expecting the date_of_death field not to be forbidden, the is_deceased’ field set to true value.The example illustrates perfectly how to use this rule to explicitly prevent contradictory input.
By Ami
asahi at 2021年04月09日 10:00:12
- 2021年4月08日
- Unity
[Unity] 3D Textの使用方法
今回はUnityの3D Objectの「3D Text」の使用方法をシェアします。
「3D Text」を使用すると、オブジェクトにテキストを配置したり、
テキスト内容や表示色等を動的に更新することができます。
nishida at 2021年04月08日 10:00:02
- 2021年4月07日
- Windows
Windows用アプリケーションのメニューバーの項目の増やし方
tanaka at 2021年04月07日 10:00:40
- 2021年4月05日
- 技術情報
Compressing images for your website
Sometimes, we have to deal with large size images in our website that cause the loading time longer. We need to manage that issue by compressing the images to a smaller without affecting largely the image resolution on the other hand.
Furthermore, we can use lazy loading to load our images on the website apart from compressing images. Firstly I will guide to some websites which provide multiple images’ compression and talk about lazy loading.
Jpeg Compression
As for the jpg and jpeg images compression, you can go to this website which allows only jpg formats images for compression that is available up to 20 images per time. After compression work, there will be a zip file of your compressed images.
Jpg & Png Compression
You have png files instead of jpg, you can use this website which allows not only jpg but also png for compression. The limitation is 20 like above one and there is one more limitation of image size 5MB. After compression work, there will also be a zip file of your compressed images.
Lazy Loading
Image lazy loading means loading images to websites asynchronously, that is, after the content in the top half of the page is fully loaded, or even conditionally, only when they appear in the browser’s viewport. This means that if users don’t scroll all the way down, the images at the bottom of the page won’t even load.
There are many types of lazy loading but I will talk about native browser lazy loading but you can also use other third parties JavaScript libraries.
<img loading = lazy> is compatible with the most popular Chromium-powered browsers (Chrome, Edge, Opera) and Firefox. WebKit (Safari) implementation is in progress. caniuse.com has detailed information on cross-browser compatibility. Browsers that don’t support the loading attribute just ignore it with no side effects.
As I said above, you are welcome to use other libraries like Lozad.js or Intersection_Observer_API also.
Yuuma
yuuma at 2021年04月05日 11:00:53