본문 바로가기

Trait As of PHP 5.4.0, PHP implements a method of code reuse called Traits. It is useful in single inheritance languages.Trait is similar class, but only it make to group functionality. For example, you need same functions in two absolutely different class.At that time declare that functions as trait and use it in your class. Like this.. The getRetuntType and getReturnDescription functions not declare.. 더보기
[Django] Use Django ORM without migrate Django ORM is wonderful framwork!!When you want to use it without migrate, can setting simply.Just set managed option to True on Meta class. class TestModel(models.Model): name = models.CharField() ... class Meta: managed = False Defaults to True, meaning Django will create the appropriate database tables in migrate or as part of migrations and remove them as part of a flush management command.T.. 더보기
Use JWT with public-key cryptography The JWT token is useful for systems that require lightweight authentication methods. I used this for login on web site.Web is public data storage differ from native application so anyone can see the data if they want.That means, anyone can get there tokens and modified if they want. To prevent this, use the JWT token.If you want to know aboud JWT token detail, see https://en.wikipedia.org/wiki/J.. 더보기
Make runner jobs with another job You can make gitlab runner jobs with another job. That means we can define jobs like a function in programming. It's cool function, when we have very similar jobs repeatedly Here's some examples. When we have many servers to deploy, we wrote .gitlab-ci.yml file like this. deploy1: script: # send local files to remote server - rsync -artlp --ignore-existing --exclude-from='.rsyncignore' ./ "$USER.. 더보기
[Sqoop] Get Error "ERROR tool.ImportTool: Imported Failed: Cannot convert SQL type 2005" Sqoop Error " ERROR tool.ImportTool: Imported Failed: Cannot convert SQL type 2005" occured from CLOB data fields. Add option --map-comumn-java. sqoop import [options...] --map-column-java CLOBFIELD=String 더보기