技術情報

Git fatal: early EOF

When I was trying to clone a repository from a remote server, I got this error fatal: early EOF fatal: index-pack failed. Normally this problem happens when the remote repository is too large and let me share with you today how I solved this issue.

You can see the full error log in below screenshot.

There are some ways to solve this issue.

If you are the owner the repository, you can configure some settings like

git gc

git gc will also perform compression on stored Git Objects, freeing up precious disk space. For more detail, you can reference here.

git repack ...

This used to combine all objects that do not currently reside in a “pack”, into a pack. It can also be used to re-organize existing packs into a single, more efficient pack. Packs are used to reduce the load on mirror systems, backup engines, disk storage, etc. Please reference more here.

If you are not the owner of the repository just a client, you still can configure post buffer setting and git depth setting like below.

//updating the post buffer setting
git config --global http.postBuffer 524288000

//cloning using depth
git clone --depth 1 <repo_url>

Depth is a feature of git to reduce server load. Instead of cloning the complete repository (as usually done with git), using clone depth just clones the last clone-depth-number revisions of your repository, also called shallow clone.

Yuuma



知っておいていただきたいこと – 8

今回も、Laravelの知っておいた方がいいとおもったことをいくつか紹介します。

Laravelでユーザーがアップロードしたファイルを使ってメールを送信する?

ファイルを保存する必要がなく、アップロードされたファイルをattachDataで添付するだけでよいことをご存知ですか?

下記を使ったMailableクラスのスニペットです。

public function build(){
    return $this->subject('Contact U')
       ->to('ex@gmail.com')
       ->markdown('email.contact')
       ->attachData(
          $this->file,
          $this->file->getClientOriginalName(),
        );
       
}

ということで、今回はこれで終わります。

金曜担当 – Ami



[Laravel] Auth 機能とMiddlewareの設定(2)

今回はLaravel標準の認証機能とMiddlewareによる認証チェック機能についての情報を
シェアしたいと思います。
本記事は前回の「[Laravel] Auth 機能とMiddlewareの設定(1)」の続きです。

続きを読む

7 Django Packages Developers Should Know

Today, I would like to share about 7 Django packages that developers should know. Let’s take a look.

1. Django REST framework

It is to build any HTTP-based REST API, providing powerful and flexible tools as well as impressive usability, authentication policies, serialization, and extensive documentation.

2. Django GUID

It is a library enabling matching a single HTTP request with all messages coming from logs. Django GUID is WSGI-supported and also ASGI-supported.

3. Django Debug Toolbar

It is a toolbar that helps debug a Django application in the browser, offering many built-in as well as third-party panels. It works on Django versions 2.2, 3.0, and 3.1.

4. Sentry

It is a service meant to monitor a running application and errors that occur when it’s working.

5. Graphene-Django

It’s about making Django data available through an interface based on GraphQL. Some tips on how to add GraphQL functionality to a Django project may be found here.

6. Django Channels

WebSocket async support in Django, available via several locations. User-friendly, flexible, allowing for customizability.

7. Django-baton

A handy, cutting-edge, responsive, and user-friendly interface for a Django admin, based on Bootstrap 5. It was created with Python, JavaScript, SCSS, HTML, and some other languages.

This is all for now. Hope you enjoy that.

By Asahi



Taking screenshots for your web app

To take screenshots of your website without using third-party services, we recommend using the html2canvas library. You can use this script to take a “screenshot” of a web page or part of it directly in the user’s browser.

As mentioned above, use the html2canvas library to take screenshots of the elements in the DOM. You can download this library with npm using the following command

npm install html2canvas

Or you can just include the asset file like this

<script src="/path/to/html2canvas.min.js"></script>

You can visit to the official Github repo here. I will add some samples working around to capture or download the screenshot.

Taking Screenshot

html2canvas(document.body).then(function(canvas) {
    var base64img = canvas.toDataURL("image/png");
    window.open(base64img);
});

Downloading with blob method

html2canvas(document.body).then(function(canvas) {
    canvas.toBlob(function(blob) {
        window.saveAs(blob, "ss.png");
    });
});

But you have to be aware of this blob method might not be available for all browsers. If you want to use the blob method , you may have to use this canvas-blob library to be able to support at all browsers.

Yuuma




アプリ関連ニュース

お問い合わせはこちら

お問い合わせ・ご相談はお電話、またはお問い合わせフォームよりお受け付けいたしております。

tel. 06-6454-8833(平日 10:00~17:00)

お問い合わせフォーム