技術情報
- 2021年12月27日
- 技術情報
Web3
The evolution of the Web is often divided into three stages: Web 1.0, Web 2.0, and Web 3.0. The Web has evolved significantly over the years, and today’s applications are a lot different from the early days.

Web 1.0
This was the first version of the web. Most of the participants were content consumers, and the creators were developers building websites that contained information presented simply in text or image format. It lasted from approximately 1991 to 2004.
They are basically static content instead of dynamic HTML(including actions and databases). The data and content was provided from a static file system rather than a database, and the sites didn’t have a lot of interactivity at all. This can also be regarded as read only web
Web 2.0
You can think of web2 as an interactive and social web. Most of us also are also interacting with web 2 nowadays.
You don’t have to be a developer to participate to be a creator. Many apps are built to make it easy for anyone to become a creator. If you want to create an idea and share it with the world, you can simply do using many platforms. If you want to upload a video or post and millions of people can watch, interact with, and comment on it.
Web 2 is really simple, and because of its simplicity, more and more people around the world are becoming creators. The current form of the web is really cool in many ways, but there are some down sides
Web 2.0 Cons
When a company releases a popular application, the user experience is usually very sophisticated as the application continues to grow in popularity. At first, many companies don’t care about monetization. They have a strict focus on growth and new user acquisition, but in the end they started making profits.
Investors often expect a return on investment and push the companies onto advertising or selling personal data instead of choosing an organic sustainable growth.
Data breaches occur often in Web2 applications. You also have no control over the data or how the data is stored. In fact, enterprises often track and store user data without the consent of the user and are managed by the enterprise responsible platforms.
On the other hand, users living in countries that have to worry about the negative effects of freedom of speeches are also at risk. Governments and other authorities often shut down servers or freeze bank accounts if they believe that a person has expressed an opinion that is going against them.
Web 3.0
Web3 improves the Internet as we know it today and has several other benefits. Self-control, trustable, no permission, decentralized, robust, etc. With web3, developers don’t create and deploy applications that run on a single server or store data in a single database.
Web3 applications run on blockchains, distributed networks of many peer-to-peer nodes (servers), or a combination of both. These applications are often referred to as Dapps (Decentralized Applications).
You will find that cryptocurrencies are usually part of a conversation on web3. Cryptocurrencies play an important role in these protocols.
People can participate in the protocol and earn a living in different ways, both technically and non-technically. Consumers of the service often pay to use the protocol. For example, you would pay a cloud provider like AWS now for a single dedicated node. But with web3, money is sent directly to the participants in the network. In these decentralization scenarios (there are other forms of decentralization as well), many unnecessary and inefficient intermediaries are no longer needed.
Let’s look at another example of organizational structure. There are projects that are becoming more popular and anyone can participate in or invest in these projects. The company announces the launch of x tokens, offering 10% to the first builder, selling 10% to the public, and booking the rest for future payments of contributors and project fundings.
Stakeholders can use the tokens to vote for future changes in the project, and those who help build the project can make money by selling some of the holdings(tokens) after the tokens are released.
People who believe in the project can buy and hold ownership and those who think the project is going in the wrong direction can lead this by selling their stock.
There are still many stuffs if we are talking about web3 but let me stop here for now. If I have any chance, I will talk about more in future.
Yuuma
yuuma at 2021年12月27日 10:00:00
- 2021年12月24日
- 技術情報
Laravelの翻訳をテストしました。美しい管理画面付きパッケージ
今回は、パッケージレビューをしたいと思います。
Joedixonのパッケージで、laravel translationsという名前です。翻訳パッケージはたくさんありますが、これはかなりシンプルで強力です。今回はその辺を紹介したいと思います。
取り付けはいたって簡単です。
composer require joedixon/laravel-translation
パブリケーションアセットの場合は、次のように追加します。
php artisan vendor:publish --provider="JoeDixon\Translation\TranslationServiceProvider"
そして、Publishingが完了すると、config/translation.phpという新しいファイルが作成されます。
これは、私の新しく作ったLaravelプロジェクトで、この翻訳ファイルを設定することができます。
我々は、ドライバを変更することができます => file, database
middlewareを追加 => [‘web’, ‘auth’].
インストールが完了したら、artisan serverコマンドを実行し、/languagesを呼び出します。
このページが表示されます。
新しい言語を追加し、既存の言語を編集することができます。


試しに1つだけ言語を変えてみて
ドライバ => file を選択したため、lang/en/auth.phpファイルに影響を与える可能性があります。

そして、この翻訳が公開されているため、ロールを制限することができます。 そのために、認証ミドルウェアを追加することができます。
'route_group_config' => [
'middleware' => ['web','auth'],
],
そして、URLを起動すると、ログインページが表示されることが確認できます。ログイン後、languagesに移動し、/languagesを入力します。
このコマンドは、アプリケーションで利用可能なすべての言語のリストを表示します。
php artisan translation:list-missing-translation-keys
例えば、:
Log in を Hey Log In に変更すると、lang/en.json に影響する可能性があります。

ログインページに移動した後、LOGINをHey Log Inテキストに変更しました。
それは日本語、韓国語などのような他の言語を追加することができます。

おわりに
というわけで、自分でもクライアントでも使いやすいlaravelの翻訳管理パッケージの静かなデモです。
最後までお読みいただき、ありがとうございました。
By Ami
asahi at 2021年12月24日 10:00:00
- 2021年12月21日
- 技術情報, Web Service
PHP Zipper package using PHP ZipArchive
Today I would like to share a PHP package that I wrote last weekend. This was written to make Zipping processes easily and automatically using PHP ZipArchive. Let’s take a look.
First of all, install the package with composer.
composer require waithaw/phpzipper
After creating Zip Object, you can use the following methods.
include_once "vendor/autoload.php";
use WaiThaw\PhpZipper\Zip;
$zip = new Zip();
These are the example file lists.
$filelists= [
'D:\testfolder\test1.txt',
'D:\testfolder\test1folder\test2.txt'
];
$file = 'D:\testfolder\test1.txt';
Creating a Zip file from Single file or multiple files
You can create an archive zip file from single file or multiple files.
1st parameter – output zip path
2nd parameter – a file or files to be zipped
3rd parameter – setting a password
- Zipping a single file or mutiple files with no password
$zip->createFromFiles('backup.zip', $file);
//OR
$zip->createFromFiles('backup.zip', $filelists);
- Zipping a single file or mutiple files with password
$zip->createFromFiles('backup.zip', $file ,'password');
//OR
$zip->createFromFiles('backup.zip', $filelists,'password');
Creating a Zip file from a directory including sub directories.
You can archive all files and subfolders in a directory into a zip file.
- Zipping a directory with no password
$zip->createFromDir('backup.zip','D:\testfolder');
- Zipping a directory with password
$zip->createFromDir('backup.zip','D:\testfolder','password');
Extracting a simple or password-protected zip file
- Extracting a simple zip file.
$zip->extractTo('backup.zip','D:\outputpath');
- Extracting a password-protected zip file
$zip->extractTo('backup.zip','D:\outputpath', 'password');
Downloading zip files
You can download the zip file at once archiving.
$zip->createFromFiles('backup.zip', $file)->download();
$zip>createFromDir('backup.zip','D:\testfolder')->download();
And you can also delete the zip file after downloaded, by passing ‘delete’ string in download() method.
$zip->createFromFiles('backup.zip', $file)->download('delete');
$zip>createFromDir('backup.zip','D:\testfolder')->download('delete');
This is all for now. I will continue to update this package for more features and details.
Hope you enjoy that.
By Asahi
waithaw at 2021年12月21日 10:00:00
- 2021年12月20日
- 技術情報
Github Wrapped
Developers normally code a lot just for a month but think for a year. If we want to see our history of our git commits, PRs, reviews etc through out a year , there is a newly service website called Github Wrapped.
You just need to login your github account and go to this website.
You may be asked for authorization to use the website from your Github account. After giving authorization this home screen will appear. I used my personal Github account for testing purpose.

Then you just need to go on by clicking the play button, these are my results.



You will also see a bunch of your activities like followers, stars etc.
But for the final result, you will get a pretty home page for your activity history through out the year (2021).

You can even copy/download your final image to save on your disk or share on twitter. I think this is a nice and pretty way to see your Github activity history for a year.
Yuuma
yuuma at 2021年12月20日 10:00:00
- 2021年12月17日
- 技術情報
Javascriptを使用して、Excelのセルにファイルアップロードを挿入する方法

今回は、Handsontableを使って、ファイルアップロードボタンを挿入する方法と、セル内に画像を表示する方法を紹介したいと思います。
Handsontableは、デフォルトで11個のエイリアスを提供することができます。
- time
- text
- select
- password
- numeric
- handsontable
- dropdown
- date
- checkbox
- base
- autocomplete
しかし、file editorでは、これまで提供できませんでした。ファイルアップロードボタンをセルに挿入することは、自分自身で発見しました。4つの方法があるのですが、今日はそのうちの1つ、cells内で呼び出されるrenderer関数を使った方法を紹介します。
今回は、rendererの呼び出し方と、ファイルアップロードボタンと画像の表示方法を中心に説明します。
まず、htmlファイルを作成し、必要なスクリプトファイルを挿入します。
<div id="example1" class="hot "></div>
<script src="https://cdn.jsdelivr.net/npm/handsontable@11.0/dist/handsontable.full.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/handsontable@11.0/dist/handsontable.full.min.css" />
次に、Handontableを作成し、cells内にrendererを呼び出すための条件をいくつか作成します。commentsとcoversにcustom renderer関数を呼び出すことにします。
const hot = new Handsontable(container, {
data,
colWidths: [100, 100, 200],
colHeaders: ['Title', 'File', 'Cover'],
colWidths: 300,
renderer: 'html',
height: 200,
columns: [
{ data: 'title' },
{ data: 'comments', renderer: safeHtmlRenderer },
{ data: 'cover', renderer: coverRenderer }
],
cells: function (row, col, prop) {
var cellProperties = {};
if(col === 1){
cellProperties.renderer = safeHtmlRenderer
}
if(col === 2){
cellProperties.renderer = coverRenderer
}
},
licenseKey: 'non-commercial-and-evaluation'
});
renderer関数の内部では、カスタムhtmlのデザインを作成し、innerHTMLプロパティでtdに挿入することができます。
function safeHtmlRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.innerHTML = '<div><input type="file" id="filechange" name="file[]" class="filebutton"></div>';
return td;
}
また、rendererで画像を表示することもできます。
function coverRenderer(instance, td, row, col, prop, value, cellProperties) {
Handsontable.renderers.TextRenderer.apply(this, arguments);
td.innerHTML = '<img src="imges/winter.jpg" width="300" height="150" >';
return td;
}
ここまでお読みいただき、ありがとうございました。
By Ami
asahi at 2021年12月17日 10:00:00