技術情報

Introduction to NFT

NFT stands for Non-Fungible Tokens (NFT) and are typically created using the same kind of programming used for cryptocurrencies. Simply put, these crypto assets are based on blockchain technology. It cannot be exchanged or traded in a comparable manner with other crypto assets.

Like Bitcoin and Ethereum. The term NFT clearly expresses that it has unique properties and cannot be replaced or exchanged. Physical currency and cryptocurrency are interchangeable. That is, they can be traded or exchanged with each other.

What Is an NFT?
Image Credit : VOA

Most NFTs reside on the Ethereum cryptocurrency blockchain, a distributed public ledger that records transactions and they are individual tokens that store valuable information. They can be bought and sold like any other kind of physical art, as it has a value set largely by the market and demand. Proprietary NFT data facilitates verification and validation of ownership and transfer of tokens between holders.

Blockchain technology and NFTs offer artists and content creators a unique opportunity to monetize their products. For example, artists no longer have to rely on galleries and auction houses to sell their art. Alternatively, the artist can sell it directly to consumers as an NFT. This also allows consumers to keep most of their profits. Additionally, artists can schedule royalties to receive a portion of the sale each time their art is sold to a new owner. This is an attractive feature. This is because artists typically do not receive future earnings after their art is first sold.

Art isn’t the only way to make money with NFTs. Brands such as Charmin and Taco Bell are auctioning NFT-themed art to raise money for charity.

Even celebrities like Snoop Dogg and Lindsay Lohan have jumped on the NFT bandwagon, releasing memorabilia, artwork, and unique moments as securitized NFTs.

Let me finish this article as it’s getting long. I still want to talk about this in near future.

Yuuma.



Custom Node JS logger class with Winston package

Today I would like to share a custom Node JS logger Class using winston package. Let’s take a look.

const winston = require('winston')
nowDate = () => {return new Date(Date.now()).toUTCString()}

class CustomLogger {
  constructor() {
    
    this.logData = null
    const logger = winston.createLogger({
      transports: [
        new winston.transports.Console(),
        new winston.transports.File({
          filename: `./logs/debug.log`
        })
      ],
      format: winston.format.printf((info) => {
        let message = `${nowDate()} | ${info.level.toUpperCase()} | debug.log | ${info.message} | `
        message = info.data ? message + `data:${JSON.stringify(info.data)} | ` : message
        message = this.logData ? message + `logData:${JSON.stringify(this.logData)} | ` : message
        return message
      })
   });
   this.logger = logger
}
setLogData(logData) {
  this.logData = logData
}
async info(message) {
  this.logger.log('info', message);
}
async info(message, data) {
  this.logger.log('info', message, {
    data
  })
}
async debug(message) {
  this.logger.log('debug', message);
}
async debug(message, data) {
  this.logger.log('debug', message, {
    data
  })
}
async error(message) {
  this.logger.log('error', message);
}
async error(message, data) {
  this.logger.log('error', message, {
    data
  })
}
}
module.exports = CustomLogger

The logger class is as above. It is very simple to use. Just call the class and instantiate the class as follows.

const Logger = require('./customLogger')
const logger = new Logger()

This is all for now. Hope you enjoy that.

By Asahi



Diagram as Code

Diagrams allow you to draw cloud system architectures in Python code. It was created to prototype a new system architecture design without the use of design tools. You can also describe or visualize your existing system architecture.

I once talked about Mermaid which is a JavaScript-based graphing and charting tool that takes Markdown-inspired text definitions and dynamically creates charts in your browser. You can read more below.

Similarly, Diagram allows us to draw system architect design using just code. Diagram currently supports all major providers including AWS, Azure, GCP, Kubernetes, Alibaba Cloud, Oracle Cloud and more.

Let’s take a quick example how this works.

from diagrams import Diagram
from diagrams.aws.compute import EC2
from diagrams.aws.database import RDS
from diagrams.aws.network import ELB

with Diagram("Grouped Workers", show=False, direction="TB"):
    ELB("lb") >> [EC2("worker1"),
                  EC2("worker2"),
                  EC2("worker3"),
                  EC2("worker4"),
                  EC2("worker5")] >> RDS("events")

This will result as below.

grouped workers diagram
Credit : diagrams.mingrammer.com

You can see we can build amazing architecture design just by using some python code. Please check more detail at their Github and quick examples here.

Yuuma



Laravel Tips

今回も、laravelのTipsをいくつか紹介します。

①別のカラムの後にカラムを追加したい場合は、afterメソッドを使用することができます。

<?php
     Schema::table('users', function(Blueprint $table){
        $table->after('email', function($table){
            $table->integer('status');
            $table->string('address');
            $table->string('city');
            $table->string('state');
         });
     });

②与えられた値がfilledかblankかを判断したい場合は、 empty()is_null() などの代わりに、ヘルパー関数 filled() を使うことができます。

filled(0);
filled(true);
filled(false);

//return true


filled('');
filled(' ');
filled(null);
filled(collection());

//return false

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

金曜担当 – Ami



Emmetの使用(2)

今回はHTMLマークアップを効率的に記述することができる
Emmet(エメット)を紹介したいと思います。
本記事は前回の「Emmetの使用(1)」の続きとなります。

続きを読む


アプリ関連ニュース

お問い合わせはこちら

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

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

お問い合わせフォーム