Kayıtlar

Strapi Create New Locale with EntityService

You can create with default id in array like below: const translated = await translate ( json . value ,                                                             { from : 'en' , to : 'iw' }); const res = await strapi . entityService                     . create ( "api::general-translation.general-translation" ,{ data : { localizations :[ defaultID ], key : json . key , value : translated . text , locale : 'he' }, populate :{ localizations : true } }) You must add localizations true p...

Rake Migration Error

Resim
That's error like that. rails aborted ! StandardError: An error has occurred, this and all later migrations canceled: Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for: class CreateFriendlyIdSlugs < ActiveRecord::Migration[4.2]  That problem due to rails version. So all you need to do, enter db>migrate folder and opened YOURDATE_create_friendly_id_slugs.rb file. Then add extend class name [5.1].       class CreateFriendlyIdSlugs < ActiveRecord :: Migration [ 5.1 ] def change create_table :friendly_id_slugs do | t | t . string :slug , :null => false t . integer :sluggable_id , :null => false t . string :sluggable_type , :limit => 50 t . string :scope t .datetime :created_at end add_index :friendly_id_slugs , :sluggable_id ...

Developers needs more lightweight option like Fleet

 Intellij infrastructure platforms, such as Android Studio and Pycharm, use more ram than necessary, which complicates the development environment. This is why vscode has become popular among developers. However, older developers continue to use vim because it is a simpler platform that requires less ram. If you're a professional developer, chances are you've heard of IntelliJ IDEA. It's a popular Integrated Development Environment (IDE) used by many developers, especially those working on Java-based projects. However, one downside of IntelliJ IDEA is that it can use more RAM than necessary, which can complicate the development environment. This is why Visual Studio Code (VS Code) has become popular in recent years - it's much lighter and doesn't require as much resources. However, some older developers still prefer to use Vim as their primary IDE. It will be due to this that in a similar way, Intellij introduced the Fleet application. Really nice design.

Faster framework for mobile apps

 Flutter is a kind of new, open-source, mobile software development kit created by Google. It allows developers to create high-quality native apps for both iOS and Android with a single codebase. Flutter is fast because it uses the Dart programming language which has been designed specifically for high-performance applications. Additionally, Flutter's hot reload feature allows you to quickly and easily test your changes without having to restart the app or recompile the code. Overall, Flutter provides an excellent way for programmers to create beautiful and fast mobile apps with less effort than traditional methods. I highly recommend giving it a try! If you're looking for a faster software programming language for mobile apps, Flutter is a great option. This open source platform was created by Google and offers cross-platform support for both iOS and Android devices. In addition, Flutter provides developers with a wide range of tools and plugins to help them create high-qualit...

Google Apps Script Custom Catch Function

 function catch(arguments,exception){     console.log(arguments.callee.name+":", "Error report",       "\r\nMessage: " + exception.message       + "\r\nFile: " + exception.fileName       + "\r\nLine: " + exception.lineNumber); }

Changing months language in PHP

In the php we are able to automatically print months with strftime function. In these cases, it is necessary to edit the locale to be able to print the months in Turkish or any language. This is not just for months, but for a lot of functions. It will be sufficient to put the following code at the beginning of your project to translate the predetermined functions. setlocale (LC_ALL, 'tr_TR.UTF-8'); You may encounter this with a lot of ready-to-go scriptions. You change 'tr_TR' section on the above line. This one-line solution will bring you to the conclusion.

Use href in HTML instead of link_to [Rails]

If you want to use href in HTML instead of link to. It's equivalent link_to in Rails. And if you want to use method you must use data-method in a tag. Reference:  http://blog.umutbey.com/en/equivalent-link_to-in-html

Object appear problem in active admin form [Ruby on Rails]

If you use active admin and if you use migration with references, in admin panel you can see object number on edit or new form. Let's say we have a company and a user table, and we have a reference to user_id in company. I assume that "belongs_to" and "has_many" added. You write in terminal "rails generate migration AddUserReferecesToCompanies user:references" and then enter commandline "rails db:migrate". Now you add this line in app/admin/companies.rb (because we are the model we initially assumed. Also you must be generated activeadmin resource like "rails g active_admin:resource company".)

Take first or last characters (Substring) with Kotlin

Sometimes you might want to get the last characters of the string or first characters. This is very easy with kotlin.

How to check a object is empty or null? (Javascript)

That code block is object check for empty or null control.

How to select element in iframe with Jquery - contents()

If you want select element in iframe, firstly find iframe selector then select your element.

Add custom or absent view groups to Anko DSL

If you want to use TextInputEditText or LottieAnimationView etc. in Anko DSL You add two lines and then use it

Extend Virtualbox Harddrive

VBoxManage modifyhd xp.vdi --resize 20000 (20000 = 20.000 MB) Write this code in shell. If using windows in VirtualBox, you are merge harddrive with new space.

How to count the lines of Android App?(Kotlin & Java)

 If you want to know how much code you have written Kotlin, Java and xml, You need to use git first. If you use it so this code enter in Android studio terminal and you learn it. wc -l $(git ls-files | grep '.*\.xml')+$(git ls-files | grep '.*\.java')+$(git ls-files | grep '.*\.kt')

How to close Android Soft KeyBoard programmatically?(Kotlin & Java)

How to hide soft keyboard on android with code? Note: Emulator does not appear, try live on the phone.

MultiDex Error like "FirebaseInitProvider Error path Android"

“Unable to get provider com.google.firebase.provider.FirebaseInitProvider” Error path Android Solution  This error shows generally on api 19. We faced that problem with Firebase when run application below API 19(< 4.4.2) devices due to error of Multidex.  We recommend that you first, add only firebase messaging or firebase crash instead of firebase core in gradle file. Using firebase core is unnecessary and will slow down the application. So maybe you do not need multidex. Anyway You can resolve the problem as follows; Add depency and add multidex.install() in attachBaseContext.

Dialog throwing "Unable to add window — token null is not for an application” Error

This is a common problem, you can not reach the context first and therefore it is null. What you need to do here is that if you use "ActivityName.this" instead of getApplicationContext(),context etc. your problem will be resolved. Like this;  

Thread that has not called Looper.prepare() Error

If you seen in Logcat like that "java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()" you probably You are trying to perform a different activity transaction ui operation. So simply  do this;